Skip to content

Commit 49fcd76

Browse files
chrisbobbegnprice
authored andcommitted
login [nfc]: Have _getUserId take just email and API key arguments
1 parent 43d95a0 commit 49fcd76

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/widgets/login.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ class _PasswordLoginPageState extends State<PasswordLoginPage> {
257257

258258
bool _inProgress = false;
259259

260-
Future<int> _getUserId(FetchApiKeyResult fetchApiKeyResult) async {
261-
final FetchApiKeyResult(:email, :apiKey) = fetchApiKeyResult;
260+
Future<int> _getUserId(String email, apiKey) async {
262261
final connection = ApiConnection.live( // TODO make this widget testable
263262
realmUrl: widget.serverSettings.realmUrl,
264263
zulipFeatureLevel: widget.serverSettings.zulipFeatureLevel,
@@ -305,7 +304,7 @@ class _PasswordLoginPageState extends State<PasswordLoginPage> {
305304
}
306305

307306
// TODO(server-7): Rely on user_id from fetchApiKey.
308-
final int userId = result.userId ?? await _getUserId(result);
307+
final int userId = result.userId ?? await _getUserId(result.email, result.apiKey);
309308
// https://github.com/dart-lang/linter/issues/4007
310309
// ignore: use_build_context_synchronously
311310
if (!context.mounted) {

0 commit comments

Comments
 (0)