mirror of
https://github.com/open-webui/computer.git
synced 2026-11-22 21:50:43 -05:00
refac
This commit is contained in:
1 parent
d057711913
commit
1c3752ed0f
1 file changed
+4
-10
@@ -5,7 +5,7 @@ import { writable, get } from 'svelte/store';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { fetchJSON } from '$lib/apis';
|
||||
import { socketStore } from '$lib/stores/socket.svelte';
|
||||
import { activeTab, openChatTab } from '$lib/stores';
|
||||
import { activeTab } from '$lib/stores';
|
||||
|
||||
export const chatEnabled = writable<boolean>(false);
|
||||
|
||||
@@ -103,15 +103,9 @@ export function bindGlobalChatListener() {
|
||||
title,
|
||||
content: body,
|
||||
onClick: async () => {
|
||||
// Navigate to workspace page first if not already there
|
||||
const wsPath = data.workspace;
|
||||
if (wsPath && window.location.pathname !== '/') {
|
||||
const { goto } = await import('$app/navigation');
|
||||
await goto(`/?workspace=${encodeURIComponent(wsPath)}`);
|
||||
setTimeout(() => openChatTab(chatId), 300);
|
||||
} else {
|
||||
openChatTab(chatId);
|
||||
}
|
||||
const { goto } = await import('$app/navigation');
|
||||
const wsParam = data.workspace ? `workspace=${encodeURIComponent(data.workspace)}&` : '';
|
||||
await goto(`/?${wsParam}chatId=${encodeURIComponent(chatId)}`);
|
||||
toast.dismiss(toastId);
|
||||
},
|
||||
onclose: () => {
|
||||
|
||||
Reference in new issue
Block a user