one bug which breaks because of force unwrapping while someone logs out
the auth session store sets the user to nil while the circlegridview tries to still display stuff
This commit is contained in:
@@ -177,10 +177,12 @@ struct CircleGridView: View {
|
||||
}
|
||||
|
||||
private func haveNewMessageFromFriend(friendDbId: String) -> Bool {
|
||||
let userId = self.authSessionStore.user!.id // O(1) // currUser who is signed in
|
||||
|
||||
if let messagesRelatedToFriend = self.authSessionStore.friendMessagesDict[friendDbId] { // O(1)
|
||||
return messagesRelatedToFriend.last?.receiverId == userId && messagesRelatedToFriend.last?.listenCount == 0
|
||||
if self.authSessionStore.user != nil {
|
||||
let userId = self.authSessionStore.user!.id // O(1) // currUser who is signed in
|
||||
|
||||
if let messagesRelatedToFriend = self.authSessionStore.friendMessagesDict[friendDbId] { // O(1)
|
||||
return messagesRelatedToFriend.last?.receiverId == userId && messagesRelatedToFriend.last?.listenCount == 0
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user