Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
3f8b1d25
Commit
3f8b1d25
authored
Nov 24, 2023
by
Timothy J. Baek
Browse files
fix: delete current chat issue
parent
4294ec6d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+7
-2
No files found.
src/routes/(app)/+layout.svelte
View file @
3f8b1d25
<script lang="ts">
import { v4 as uuidv4 } from 'uuid';
import { openDB, deleteDB } from 'idb';
import { onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import { config, user, showSettings, settings, models, db, chats } from '$lib/stores';
import { config, user, showSettings, settings, models, db, chats
, chatId
} from '$lib/stores';
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
import Sidebar from '$lib/components/layout/Sidebar.svelte';
import toast from 'svelte-french-toast';
import { OLLAMA_API_BASE_URL } from '$lib/constants';
import { OLLAMA_API_BASE_URL
, WEBUI_API_BASE_URL
} from '$lib/constants';
let loaded = false;
...
...
@@ -133,6 +134,10 @@
await chats.set(await this.getChats());
},
deleteChatById: async function (id) {
if ($chatId === id) {
goto('/');
await chatId.set(uuidv4());
}
await this.db.delete('chats', id);
await chats.set(await this.getChats());
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment