From fce8d48de6672f3fea571cfa78df06deb7b0e421 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Sun, 19 Nov 2023 05:13:38 +0000 Subject: [PATCH] fix(mobile): use proper context for popping out from share (#5138) * fix(mobile): use proper context for popping out from share * mobile: use proper context for popping --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/modules/album/ui/album_viewer_appbar.dart | 2 +- .../providers/image_viewer_page_state.provider.dart | 2 +- mobile/lib/utils/selection_handlers.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/lib/modules/album/ui/album_viewer_appbar.dart b/mobile/lib/modules/album/ui/album_viewer_appbar.dart index 1ac64e957e..cd0bd2ba61 100644 --- a/mobile/lib/modules/album/ui/album_viewer_appbar.dart +++ b/mobile/lib/modules/album/ui/album_viewer_appbar.dart @@ -188,7 +188,7 @@ class AlbumViewerAppbar extends HookConsumerWidget gravity: ToastGravity.BOTTOM, ); } - context.pop(); + buildContext.pop(); }, ); return const ShareDialog(); diff --git a/mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart b/mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart index b7f6ee0950..06cc128f7f 100644 --- a/mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart +++ b/mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart @@ -68,7 +68,7 @@ class ImageViewerStateNotifier extends StateNotifier { gravity: ToastGravity.BOTTOM, ); } - context.pop(); + buildContext.pop(); }, ); return const ShareDialog(); diff --git a/mobile/lib/utils/selection_handlers.dart b/mobile/lib/utils/selection_handlers.dart index 5d13d20a28..d52f3ac1db 100644 --- a/mobile/lib/utils/selection_handlers.dart +++ b/mobile/lib/utils/selection_handlers.dart @@ -27,7 +27,7 @@ void handleShareAssets( gravity: ToastGravity.BOTTOM, ); } - context.pop(); + buildContext.pop(); }, ); return const ShareDialog();