Skip to content

Commit

Permalink
Merge pull request #667 from 4ster1sk/fix/tab-setting-freeze
Browse files Browse the repository at this point in the history
タブ設定、設定のインポートでフリーズするのを修正
  • Loading branch information
shiosyakeyakini-info authored Nov 10, 2024
2 parents fe7b1c5 + 05071b7 commit b7ab5f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 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());
await context.router.pushAndPopUntil(
const SplashRoute(),
predicate: (_) => false,
);
}

Future<void> export(BuildContext context, Account account) async {
Expand Down
12 changes: 4 additions & 8 deletions lib/view/settings_page/account_settings_page/account_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,10 @@ class AccountListPage extends ConsumerWidget {
child: Padding(
padding: const EdgeInsets.all(10),
child: ElevatedButton(
onPressed: () async {
final newState = ref.refresh(accountsProvider);
print(newState);
final router = context.router..removeWhere((route) => true);
WidgetsBinding.instance.addPostFrameCallback((_) async {
await router.push(const SplashRoute());
});
},
onPressed: () async => await context.router.pushAndPopUntil(
const SplashRoute(),
predicate: (_) => false,
),
child: Text(S.of(context).quitAccountSettings),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class TabSettingsListPage extends ConsumerWidget {
child: Padding(
padding: const EdgeInsets.all(10),
child: ElevatedButton(
onPressed: () async {
context.router.removeWhere((route) => true);
await context.router.push(const SplashRoute());
},
onPressed: () async => await context.router.pushAndPopUntil(
const SplashRoute(),
predicate: (_) => false,
),
child: Text(S.of(context).apply),
),
),
Expand Down

0 comments on commit b7ab5f7

Please sign in to comment.