File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
LabelStoreMax/lib/resources/pages Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments