Skip to content

Commit b585484

Browse files
committed
refactor(user_repository): cleanup user snapshot mapping
1 parent b69ceac commit b585484

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/user_repository/lib/src/firebase_user_repository.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,11 @@ extension _FirebaseAuthExtensions on FirebaseAuth {
157157
return;
158158
}
159159

160-
yield* firestore
161-
.userDoc(firebaseUser.uid)
162-
.snapshots()
163-
.map((snapshot) {
164-
if (snapshot.exists) {
165-
return User.fromJson(snapshot.data()!);
166-
}
167-
return User.none;
168-
});
160+
yield* firestore.userDoc(firebaseUser.uid).snapshots().map(
161+
(snapshot) => snapshot.exists
162+
? User.fromJson(snapshot.data()!)
163+
: User.none,
164+
);
169165
},
170166
)
171167
.handleError((Object _) => throw UserFailure.fromAuthUserChanges())

0 commit comments

Comments
 (0)