Skip to content

Commit 8cd0e0a

Browse files
committed
app: On launch, go to the last visited account
Fixes: #524
1 parent 1ae22a7 commit 8cd0e0a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/widgets/app.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,13 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {
211211
];
212212
}
213213

214-
final globalStore = GlobalStoreWidget.of(context);
215-
// TODO(#524) choose initial account as last one used
216-
final initialAccountId = globalStore.accounts.firstOrNull?.id;
214+
final lastAccountId = GlobalStoreWidget.settingsOf(context)
215+
.getInt(IntGlobalSetting.lastVisitedAccountId);
217216
return [
218-
if (initialAccountId == null)
217+
if (lastAccountId == null)
219218
MaterialWidgetRoute(page: const ChooseAccountPage())
220219
else
221-
HomePage.buildRoute(accountId: initialAccountId),
220+
HomePage.buildRoute(accountId: lastAccountId),
222221
];
223222
}
224223

0 commit comments

Comments
 (0)