mirror of
https://github.com/open-webui/open-webui
synced 2025-06-10 16:38:21 +00:00
refac
This commit is contained in:
parent
1d53754ea7
commit
44e7e09784
@ -11,6 +11,8 @@
|
||||
|
||||
import Modal from '$lib/components/common/Modal.svelte';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||
|
||||
import Spinner from '../common/Spinner.svelte';
|
||||
import Loader from '../common/Loader.svelte';
|
||||
import XMark from '../icons/XMark.svelte';
|
||||
@ -33,7 +35,9 @@
|
||||
export let allChatsLoaded = false;
|
||||
export let chatListLoading = false;
|
||||
|
||||
let selectedChatId = null;
|
||||
let selectedIdx = 0;
|
||||
let showDeleteConfirmDialog = false;
|
||||
|
||||
export let onUpdate = () => {};
|
||||
|
||||
@ -58,6 +62,16 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<ConfirmDialog
|
||||
bind:show={showDeleteConfirmDialog}
|
||||
on:confirm={() => {
|
||||
if (selectedChatId) {
|
||||
deleteHandler(selectedChatId);
|
||||
selectedChatId = null;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
<Modal size="lg" bind:show>
|
||||
<div>
|
||||
<div class=" flex justify-between dark:text-gray-300 px-5 pt-4 pb-1">
|
||||
@ -261,7 +275,8 @@
|
||||
on:click={async (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
e.stopPropagation();
|
||||
deleteHandler(chat.id);
|
||||
selectedChatId = chat.id;
|
||||
showDeleteConfirmDialog = true;
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
|
Loading…
Reference in New Issue
Block a user