Skip to content

Commit

Permalink
refactor: fix requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bkalil committed Oct 23, 2024
1 parent d07f80d commit 7041a84
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/gotrue/lib/src/types/user_attributes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ class UserAttributes {
}

@override
bool operator ==(covariant UserAttributes other) {
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! UserAttributes) return false;

final mapEquals = const DeepCollectionEquality().equals;

return other.email == email &&
other.phone == phone &&
other.password == password &&
other.nonce == nonce &&
other.data == data;
mapEquals(other.data, data);
}

@override
Expand Down Expand Up @@ -127,8 +130,10 @@ class AdminUserAttributes extends UserAttributes {
}

@override
bool operator ==(covariant AdminUserAttributes other) {
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! AdminUserAttributes) return false;

final mapEquals = const DeepCollectionEquality().equals;

return mapEquals(other.userMetadata, userMetadata) &&
Expand All @@ -140,7 +145,8 @@ class AdminUserAttributes extends UserAttributes {

@override
int get hashCode {
return userMetadata.hashCode ^
return super.hashCode ^
userMetadata.hashCode ^
appMetadata.hashCode ^
emailConfirm.hashCode ^
phoneConfirm.hashCode ^
Expand Down

0 comments on commit 7041a84

Please sign in to comment.