-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new biometricCheck AuthStatus and logic based on it is implemented (KIDS-748) #659
Conversation
|
||
final biometricSetting = await BiometricsHelper.getBiometricSetting(); | ||
|
||
emit( | ||
state.copyWith( | ||
status: AuthStatus.authenticated, | ||
status: biometricSetting == BiometricSetting.unknown | ||
? AuthStatus.biometricCheck | ||
: AuthStatus.authenticated, | ||
user: userExt, | ||
session: session, | ||
navigate: navigate, | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling opinion but i would wrap the emit in a guarded if statement like
If (biometricSetting == BiometricSetting.unknown){
emit(
state.copyWith(
status: AuthStatus.biometricCheck,
user: userExt,
session: session,
navigate: navigate,
),
);
return;
}
I think its easier to follow, but its just an opinion 🦐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps, but in this case we will have two emits, so not sure what is better)
void clearNavigation() => emit( | ||
state.copyWith( | ||
status: state.status, | ||
navigate: AuthState._emptyNavigate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, why does _emptyNavigate have an underscore, when it isnt private 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's private for AuthCubit/AuthState so cannot be accessed outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh never digested that cubit and state share private classes, cool!
Description