Skip to content

Commit

Permalink
Merge pull request #312 from emad-deriv/emad/update_is_migrated_logic
Browse files Browse the repository at this point in the history
Emad/update migrated user logic
  • Loading branch information
ramin-deriv authored Oct 18, 2023
2 parents 3921dec + 9db9112 commit 71f1990
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ class DerivAuthLoggedInState extends DerivAuthState {
final DerivAuthModel authModel;

/// Indicates if the user is migrated to wallets or not.
///
/// The user is considered migrated if at least one of their accounts
/// is [AccountCategoryEnum.wallet]
bool get isMigratedToWallets =>
authModel.authorizeEntity.linkedTo?.isNotEmpty ?? false;
authModel.authorizeEntity.accountList?.any((AccountListItem account) =>
account.accountCategory == AccountCategoryEnum.wallet) ??
false;
}

/// Logged out state.
Expand Down

0 comments on commit 71f1990

Please sign in to comment.