Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix back navigation to clear search on home page

ashilknaf506bf6c05b
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index 35f3f5b560..15b0eaf0c2 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -559,13 +559,20 @@ class _HomePageState extends UploaderPageState<HomePage>
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
return PopScope(
- onPopInvokedWithResult: (_, result) async {
+ canPop: !isSearchActive && !_isSettingsOpen,
+ onPopInvokedWithResult: (didPop, result) async {
+ if (didPop) {
+ return;
+ }
+
+ if (isSearchActive) {
+ _handleClearSearch();
+ return;
+ }
+
if (_isSettingsOpen) {
scaffoldKey.currentState!.closeDrawer();
return;
- } else if (!Platform.isAndroid) {
- Navigator.of(context).pop();
- return;
}
},
child: KeyboardListener(