Skip to content

Commit

Permalink
Don't try saving inactive sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
lmg-anon committed Dec 22, 2024
1 parent eecca8d commit 2516553
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mikupad.html
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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]);

Expand Down

0 comments on commit 2516553

Please sign in to comment.