Skip to content

Commit

Permalink
[mob][photos] Stop popping root navigator to avoid black screen from …
Browse files Browse the repository at this point in the history
…appearing
  • Loading branch information
ashilkn committed Oct 21, 2024
1 parent 04b4b6c commit 9713e96
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions mobile/lib/ui/account/delete_account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import "package:photos/utils/toast_util.dart";

class DeleteAccountPage extends StatefulWidget {
const DeleteAccountPage({
Key? key,
}) : super(key: key);
super.key,
});

@override
State<DeleteAccountPage> createState() => _DeleteAccountPageState();
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/ui/account/sessions_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class _SessionsPageState extends State<SessionsPage> {
),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
if (isLoggingOutFromThisDevice) {
await UserService.instance.logout(context);
} else {
Expand All @@ -202,7 +202,7 @@ class _SessionsPageState extends State<SessionsPage> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],
Expand Down
3 changes: 1 addition & 2 deletions mobile/lib/ui/home/grant_permissions_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ class _GrantPermissionsWidgetState extends State<GrantPermissionsWidget> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true)
.pop('dialog');
Navigator.of(context).pop('dialog');
if (Platform.isIOS) {
PhotoManager.openSetting();
}
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/ui/settings/debug/debug_section_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class DebugSectionWidget extends StatelessWidget {
TextButton(
child: const Text("OK"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/ui/settings/security_section_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
),
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
TextButton(
Expand All @@ -241,7 +241,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
),
onPressed: () async {
await UserService.instance.disableTwoFactor(context);
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/ui/tabs/home_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class _HomeWidgetState extends State<HomeWidget> {
),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
Navigator.of(context).popUntil((route) => route.isFirst);
final dialog =
createProgressDialog(context, S.of(context).loggingOut);
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/ui/viewer/actions/delete_empty_albums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
onTap: () async {
await _deleteEmptyAlbums();
if (!_isCancelled) {
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
}
Bus.instance.fire(
CollectionUpdatedEvent(
Expand All @@ -104,7 +104,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
shouldStickToDarkTheme: true,
onTap: () async {
_isCancelled = true;
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
],
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/ui/viewer/file/exif_info_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ExifInfoDialog extends StatelessWidget {
style: textTheme.body,
),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).pop('dialog');
},
),
],
Expand Down
6 changes: 3 additions & 3 deletions mobile/lib/utils/email_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Future<void> _sendLogs(
await FlutterEmailSender.send(email);
} catch (e, s) {
_logger.severe('email sender failed', e, s);
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
await shareLogs(context, toEmail, zipFilePath);
}
}
Expand Down Expand Up @@ -275,14 +275,14 @@ Future<void> sendEmail(
emailContent: content,
);

Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
],
cancelButton: CupertinoActionSheetAction(
child: Text(S.of(context).cancel),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop();
},
),
),
Expand Down

0 comments on commit 9713e96

Please sign in to comment.