Skip to content

Commit ab2a195

Browse files
committed
update account_landing.dart
1 parent ba5ddc1 commit ab2a195

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

LabelStoreMax/lib/resources/pages/account_landing.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,17 @@ class _AccountLandingPageState extends NyState<AccountLandingPage> {
219219
icon: Icons.account_circle);
220220
}
221221

222-
if (wpUserLoginResponse != null && wpUserLoginResponse.status == 200) {
222+
if (wpUserLoginResponse == null) {
223+
return;
224+
}
225+
226+
if (wpUserLoginResponse.status != 200) {
227+
return;
228+
}
223229
String? token = wpUserLoginResponse.data!.userToken;
224230
String userId = wpUserLoginResponse.data!.userId.toString();
225231
User user = User.fromUserAuthResponse(token: token, userId: userId);
226-
user.save(SharedKey.authUser);
232+
await user.save(SharedKey.authUser);
227233

228234
showToastNotification(context,
229235
title: trans("Hello"),
@@ -232,7 +238,7 @@ class _AccountLandingPageState extends NyState<AccountLandingPage> {
232238
icon: Icons.account_circle);
233239
navigatorPush(context,
234240
routeName: UserAuth.instance.redirect, forgetLast: 1);
235-
}
241+
236242
});
237243
}
238244
}

0 commit comments

Comments
 (0)