Add lastChatId, but disable use for now

This commit is contained in:
Webifi
2023-06-24 09:18:29 -05:00
parent 69f514a69f
commit 86092afcb0
2 changed files with 20 additions and 1 deletions

View File

@@ -20,7 +20,9 @@
export let pinMainMenu = writable(false) // Show menu (for mobile use)
export let continueMessage = writable('') //
export let currentChatMessages = writable([] as Message[])
export let started = writable(false)
export let currentChatId = writable(0)
export let lastChatId = persisted('currentChatId', 0)
const chatDefaults = getChatDefaults()
@@ -227,10 +229,12 @@
clearTimeout(setChatTimer)
if (!chatId) {
currentChatId.set(0)
lastChatId.set(0)
currentChatMessages.set([])
}
setChatTimer = setTimeout(() => {
currentChatId.set(chatId)
lastChatId.set(chatId)
currentChatMessages.set(getChat(chatId).messages)
}, 10)
}