optional chaining

This commit is contained in:
Henry Jameson 2026-08-04 18:04:20 +03:00
commit 5ea3d462b9
34 changed files with 68 additions and 77 deletions

View file

@ -69,8 +69,8 @@ export const useChatsStore = defineStore('chats', {
if (chat) {
const isNewMessage =
(chat.lastMessage && chat.lastMessage.id) !==
(updatedChat.lastMessage && updatedChat.lastMessage.id)
(chat.lastMessage?.id) !==
(updatedChat.lastMessage?.id)
chat.lastMessage = updatedChat.lastMessage
chat.unread = updatedChat.unread
chat.updated_at = updatedChat.updated_at