[mob][photos] Stop popping root navigator to avoid black screen from appearing
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
@@ -202,7 +202,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
Navigator.of(context).pop('dialog');
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -229,7 +229,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
Navigator.of(context).pop('dialog');
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
@@ -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');
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
@@ -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();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -41,7 +41,7 @@ class ExifInfoDialog extends StatelessWidget {
|
||||
style: textTheme.body,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
Navigator.of(context).pop('dialog');
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user