fix marking chat as read

This commit is contained in:
Henry Jameson 2026-08-25 21:42:45 +03:00
commit 61f25e4f0f

View file

@ -248,6 +248,7 @@ const Chat = {
useUsersStore().addNewUsers({ ...result, data: data.account }) useUsersStore().addNewUsers({ ...result, data: data.account })
data.account = useUsersStore().findUser(data.account.id) data.account = useUsersStore().findUser(data.account.id)
this.chat = data this.chat = data
this.maxId = this.chat.lastMessage?.id
} catch (e) { } catch (e) {
console.error('Error creating or getting a chat', e) console.error('Error creating or getting a chat', e)
this.errorLoadingChat = true this.errorLoadingChat = true
@ -255,10 +256,10 @@ const Chat = {
} }
if (this.isConversation || this.chat) { if (this.isConversation || this.chat) {
this.startFetching('Chat activated', true)
this.$nextTick(() => { this.$nextTick(() => {
this.scrollDown({ forceRead: true }) this.scrollDown({ forceRead: true })
}) })
this.startFetching('Chat activated', true)
} }
}, },
deactivate() { deactivate() {