From a136c150ad1476b23e9f7bd9e21bd9cf2ddc7226 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 14 Apr 2025 11:12:28 +0800 Subject: [PATCH] opt: download dialog Signed-off-by: bggRGjQaUbCoE --- lib/utils/download.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/utils/download.dart b/lib/utils/download.dart index 5f367314..5b458e5c 100644 --- a/lib/utils/download.dart +++ b/lib/utils/download.dart @@ -242,25 +242,22 @@ class DownloadUtils { } } } - // `SmartDialog.dismiss();` will call `onDismiss();` if (cancelToken.isCancelled) { - SmartDialog.dismiss(status: SmartStatus.loading); SmartDialog.showToast('已取消下载'); return false; } else { - SmartDialog.dismiss(status: SmartStatus.loading); SmartDialog.showToast('图片已保存'); } return true; } catch (e) { if (cancelToken.isCancelled) { - SmartDialog.dismiss(status: SmartStatus.loading); SmartDialog.showToast('已取消下载'); } else { - SmartDialog.dismiss(status: SmartStatus.loading); SmartDialog.showToast(e.toString()); } return false; + } finally { + SmartDialog.dismiss(status: SmartStatus.loading); } } }