From 2516553a51f2ad1dbdcd3857918d738f5cdd11bb Mon Sep 17 00:00:00 2001 From: lmg-anon <139719567+lmg-anon@users.noreply.github.com> Date: Sun, 22 Dec 2024 10:47:13 -0300 Subject: [PATCH] Don't try saving inactive sessions --- mikupad.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mikupad.html b/mikupad.html index 1a84157..ba73fb5 100644 --- a/mikupad.html +++ b/mikupad.html @@ -5223,7 +5223,7 @@ } async saveSessionToDB(sessionId) { - if (!this.sessions[sessionId]) + if (!this.sessions[sessionId] || this.sessions[sessionId].inactive) return; const db = await this.openDatabase(); await this.saveToDatabase(db, sessionId, this.sessions[sessionId]); @@ -5302,7 +5302,7 @@ //Clear data of old session in order to minimize memory usage. if (this.sessions[this.selectedSession] && this.sessions[this.selectedSession]['name']) - this.sessions[this.selectedSession] = { name: this.sessions[this.selectedSession]['name'] }; + this.sessions[this.selectedSession] = { name: this.sessions[this.selectedSession]['name'], inactive: true }; const db = await this.openDatabase(); await this.saveToDatabase(db, 'selectedSessionId', +sessionId); @@ -6231,7 +6231,7 @@ ac.signal.addEventListener('abort', () => clearTimeout(to)); return () => ac.abort(); - }, [finalPromptText, showPromptPreview, promptPreviewReroll, promptPreviewTokens, cancel, endpoint, endpointAPI, endpointAPIKey]); + }, [finalPromptText, showPromptPreview, promptPreviewReroll, cancel, endpoint, endpointAPI, endpointAPIKey]); const promptPreviewText = useMemo(() => joinPrompt(promptPreviewChunks), [promptPreviewChunks]);