Skip to content

Commit

Permalink
タブ設定、設定のインポートでフリーズするのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Nov 9, 2024
1 parent 47cefb3 commit 18e5b53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/repository/import_export_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ class ImportExportRepository extends ChangeNotifier {
await SimpleMessageDialog.show(context, S.of(context).importCompleted);

if (!context.mounted) return;
context.router.removeWhere((route) => true);
await context.router.push(const SplashRoute());
final router = context.router..removeWhere((route) => true);
WidgetsBinding.instance.addPostFrameCallback((_) async {
await router.push(const SplashRoute());
});
}

Future<void> export(BuildContext context, Account account) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ class TabSettingsListPage extends ConsumerWidget {
padding: const EdgeInsets.all(10),
child: ElevatedButton(
onPressed: () async {
context.router.removeWhere((route) => true);
await context.router.push(const SplashRoute());
final router = context.router..removeWhere((route) => true);
WidgetsBinding.instance.addPostFrameCallback((_) async {
await router.push(const SplashRoute());
});
},
child: Text(S.of(context).apply),
),
Expand Down

0 comments on commit 18e5b53

Please sign in to comment.