mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-22 06:59:21 +01:00
Fix exceptions not caught for download notification
This commit is contained in:
parent
734807733c
commit
c928c2cf74
1 changed files with 3 additions and 3 deletions
|
@ -454,7 +454,7 @@ class _ViewerState extends State<Viewer>
|
||||||
try {
|
try {
|
||||||
result = await DownloadFile()(widget.account, file);
|
result = await DownloadFile()(widget.account, file);
|
||||||
controller?.close();
|
controller?.close();
|
||||||
_onDownloadSuccessful(file, result);
|
await _onDownloadSuccessful(file, result);
|
||||||
} on PermissionException catch (_) {
|
} on PermissionException catch (_) {
|
||||||
_log.warning("[_onDownloadPressed] Permission not granted");
|
_log.warning("[_onDownloadPressed] Permission not granted");
|
||||||
controller?.close();
|
controller?.close();
|
||||||
|
@ -476,7 +476,7 @@ class _ViewerState extends State<Viewer>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onDownloadSuccessful(File file, dynamic result) {
|
Future<void> _onDownloadSuccessful(File file, dynamic result) async {
|
||||||
dynamic notif;
|
dynamic notif;
|
||||||
if (platform_k.isAndroid) {
|
if (platform_k.isAndroid) {
|
||||||
notif = AndroidItemDownloadSuccessfulNotification(
|
notif = AndroidItemDownloadSuccessfulNotification(
|
||||||
|
@ -484,7 +484,7 @@ class _ViewerState extends State<Viewer>
|
||||||
}
|
}
|
||||||
if (notif != null) {
|
if (notif != null) {
|
||||||
try {
|
try {
|
||||||
notif.notify();
|
await notif.notify();
|
||||||
return;
|
return;
|
||||||
} catch (e, stacktrace) {
|
} catch (e, stacktrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
|
|
Loading…
Reference in a new issue