mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 16:04:43 +01:00
Fix misusing context after widget disposed
This commit is contained in:
parent
49fa4d320b
commit
90b79a65e0
1 changed files with 11 additions and 5 deletions
|
@ -388,7 +388,9 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
||||||
try {
|
try {
|
||||||
await UpdateProperty(fileRepo)
|
await UpdateProperty(fileRepo)
|
||||||
.updateIsArchived(widget.account, widget.file, true);
|
.updateIsArchived(widget.account, widget.file, true);
|
||||||
Navigator.of(context).pop();
|
if (mounted) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onArchivePressed] Failed while archiving file" +
|
"[_onArchivePressed] Failed while archiving file" +
|
||||||
|
@ -412,7 +414,9 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
||||||
try {
|
try {
|
||||||
await UpdateProperty(fileRepo)
|
await UpdateProperty(fileRepo)
|
||||||
.updateIsArchived(widget.account, widget.file, false);
|
.updateIsArchived(widget.account, widget.file, false);
|
||||||
Navigator.of(context).pop();
|
if (mounted) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onUnarchivePressed] Failed while archiving file" +
|
"[_onUnarchivePressed] Failed while archiving file" +
|
||||||
|
@ -448,9 +452,11 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
||||||
try {
|
try {
|
||||||
await UpdateProperty(fileRepo)
|
await UpdateProperty(fileRepo)
|
||||||
.updateOverrideDateTime(widget.account, widget.file, value);
|
.updateOverrideDateTime(widget.account, widget.file, value);
|
||||||
setState(() {
|
if (mounted) {
|
||||||
_dateTime = value;
|
setState(() {
|
||||||
});
|
_dateTime = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (e, stacktrace) {
|
} catch (e, stacktrace) {
|
||||||
_log.shout(
|
_log.shout(
|
||||||
"[_onDateTimeTap] Failed while updateOverrideDateTime" +
|
"[_onDateTimeTap] Failed while updateOverrideDateTime" +
|
||||||
|
|
Loading…
Add table
Reference in a new issue