Skip to content

Commit

Permalink
Update profile_name_bloc.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Dec 11, 2024
1 parent d841efd commit 61c9873
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/user/name/presentation/bloc/profile_name_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class ProfileNameBloc extends Bloc<ProfileNameEvent, ProfileNameState> {
final primaryName =
await _arnsRepository.getPrimaryName(walletAddress, update: refresh);

if (_auth.currentUser.walletAddress != walletAddress) {
// A user can load profile name and log out while fetching this request. Then log in again. We should not emit a profile name loaded state in this case.
logger.d('User logged out while fetching profile name');

return;
}

emit(ProfileNameLoaded(primaryName, walletAddress));
} catch (e) {
if (e is PrimaryNameNotFoundException) {
Expand Down

0 comments on commit 61c9873

Please sign in to comment.