fix: redirect to login page after deleting account on Android (#6206)

This commit is contained in:
Lucas.Xu 2024-09-09 09:28:29 +08:00 committed by GitHub
parent 53a2b7cb6e
commit 944da858a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 6 deletions

View File

@ -172,7 +172,6 @@ class _DeleteAccountBottomSheetState extends State<_DeleteAccountBottomSheet> {
context,
controller.text.trim(),
isChecked.value,
onSuccess: () => Navigator.of(context).pop(),
),
),
const VSpace(12.0),

View File

@ -19,7 +19,7 @@ class Loading {
if (hasStopped) {
WidgetsBinding.instance.addPostFrameCallback((_) {
Navigator.of(loadingContext!).pop();
Navigator.of(loadingContext!).maybePop();
loadingContext = null;
});
}

View File

@ -2,7 +2,6 @@ import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/widgets/loading.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/auth/auth_service.dart';
import 'package:appflowy/user/application/user_service.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/shared_widget.dart';
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart';
@ -209,7 +208,6 @@ Future<void> deleteMyAccount(
);
return;
}
if (!context.mounted) {
return;
}
@ -238,7 +236,6 @@ Future<void> deleteMyAccount(
message: LocaleKeys
.newSettings_myAccount_deleteAccount_deleteAccountSuccess
.tr(),
bottomPadding: bottomPadding,
);
// delay 1 second to make sure the toast notification is shown
@ -246,7 +243,6 @@ Future<void> deleteMyAccount(
onSuccess?.call();
// restart the application
await getIt<AuthService>().signOut();
await runAppFlowy();
});
},