mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: download dialog
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user