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) {
|
if (cancelToken.isCancelled) {
|
||||||
SmartDialog.dismiss(status: SmartStatus.loading);
|
|
||||||
SmartDialog.showToast('已取消下载');
|
SmartDialog.showToast('已取消下载');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.dismiss(status: SmartStatus.loading);
|
|
||||||
SmartDialog.showToast('图片已保存');
|
SmartDialog.showToast('图片已保存');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (cancelToken.isCancelled) {
|
if (cancelToken.isCancelled) {
|
||||||
SmartDialog.dismiss(status: SmartStatus.loading);
|
|
||||||
SmartDialog.showToast('已取消下载');
|
SmartDialog.showToast('已取消下载');
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.dismiss(status: SmartStatus.loading);
|
|
||||||
SmartDialog.showToast(e.toString());
|
SmartDialog.showToast(e.toString());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
} finally {
|
||||||
|
SmartDialog.dismiss(status: SmartStatus.loading);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user