Skip to content

Commit 256fa7e

Browse files
gnpricechrisbobbe
authored andcommitted
nav: Go straight to inbox on launch, when an account available
Fixes: #516
1 parent cbca1e2 commit 256fa7e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/widgets/app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class ZulipApp extends StatelessWidget {
148148
MaterialWidgetRoute(page: const ChooseAccountPage()),
149149
if (initialAccountId != null) ...[
150150
HomePage.buildRoute(accountId: initialAccountId),
151+
InboxPage.buildRoute(accountId: initialAccountId),
151152
],
152153
];
153154
});

test/notifications_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:zulip/model/narrow.dart';
1212
import 'package:zulip/model/store.dart';
1313
import 'package:zulip/notifications.dart';
1414
import 'package:zulip/widgets/app.dart';
15+
import 'package:zulip/widgets/inbox.dart';
1516
import 'package:zulip/widgets/message_list.dart';
1617
import 'package:zulip/widgets/page.dart';
1718

@@ -198,6 +199,9 @@ void main() {
198199
(Subject it) => it.isA<MaterialAccountWidgetRoute>()
199200
..accountId.equals(eg.selfAccount.id)
200201
..page.isA<HomePage>(),
202+
(Subject it) => it.isA<MaterialAccountWidgetRoute>()
203+
..accountId.equals(eg.selfAccount.id)
204+
..page.isA<InboxPage>(),
201205
],
202206
];
203207
check(pushedRoutes.take(expected.length)).deepEquals(expected);

test/widgets/app_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:checks/checks.dart';
22
import 'package:flutter/widgets.dart';
33
import 'package:flutter_test/flutter_test.dart';
44
import 'package:zulip/widgets/app.dart';
5+
import 'package:zulip/widgets/inbox.dart';
56
import 'package:zulip/widgets/page.dart';
67

78
import '../example_data.dart' as eg;
@@ -31,7 +32,7 @@ void main() {
3132
]);
3233
});
3334

34-
testWidgets('when have accounts, go to home page for first account', (tester) async {
35+
testWidgets('when have accounts, go to inbox for first account', (tester) async {
3536
addTearDown(testBinding.reset);
3637

3738
// We'll need per-account data for the account that a page will be opened
@@ -44,6 +45,9 @@ void main() {
4445
(Subject it) => it.isA<MaterialAccountWidgetRoute>()
4546
..accountId.equals(eg.selfAccount.id)
4647
..page.isA<HomePage>(),
48+
(Subject it) => it.isA<MaterialAccountWidgetRoute>()
49+
..accountId.equals(eg.selfAccount.id)
50+
..page.isA<InboxPage>(),
4751
]);
4852
});
4953
});

0 commit comments

Comments
 (0)