Skip to content

Commit c67a4cc

Browse files
committed
login [nfc]: Tighten up some if-unmounted-returns; remove stale lint-ignore
1 parent a55d8a9 commit c67a4cc

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/widgets/login.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,16 @@ class _AddAccountPageState extends State<AddAccountPage> {
184184
connection.close();
185185
}
186186
} catch (e) {
187-
if (!context.mounted) {
188-
return;
189-
}
187+
if (!context.mounted) return;
188+
190189
// TODO(#105) give more helpful feedback; see `fetchServerSettings`
191190
// in zulip-mobile's src/message/fetchActions.js.
192191
showErrorDialog(context: context,
193192
title: zulipLocalizations.errorCouldNotConnectTitle,
194193
message: zulipLocalizations.errorLoginCouldNotConnect(url.toString()));
195194
return;
196195
}
197-
// https://github.com/dart-lang/linter/issues/4007
198-
// ignore: use_build_context_synchronously
199-
if (!context.mounted) {
200-
return;
201-
}
196+
if (!context.mounted) return;
202197

203198
unawaited(Navigator.push(context,
204199
LoginPage.buildRoute(serverSettings: serverSettings)));

0 commit comments

Comments
 (0)