mirror of
https://github.com/open-webui/open-webui
synced 2025-04-03 12:31:32 +00:00
enh: temporary-chat url search param
This commit is contained in:
parent
a93b0ac143
commit
dc4c6b3b14
@ -270,9 +270,11 @@
|
||||
//////////////////////////
|
||||
|
||||
const initNewChat = async () => {
|
||||
window.history.replaceState(history.state, '', `/`);
|
||||
await chatId.set('');
|
||||
if ($page.url.pathname.includes('/c/')) {
|
||||
window.history.replaceState(history.state, '', `/`);
|
||||
}
|
||||
|
||||
await chatId.set('');
|
||||
autoScroll = true;
|
||||
|
||||
title = '';
|
||||
|
@ -533,6 +533,14 @@
|
||||
setTimeout(() => {
|
||||
newChatButton?.click();
|
||||
}, 0);
|
||||
|
||||
// add 'temporary-chat=true' to the URL
|
||||
if ($temporaryChatEnabled) {
|
||||
history.replaceState(null, '', '?temporary-chat=true');
|
||||
} else {
|
||||
history.replaceState(null, '', location.pathname);
|
||||
}
|
||||
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
|
@ -32,7 +32,8 @@
|
||||
config,
|
||||
showCallOverlay,
|
||||
tools,
|
||||
functions
|
||||
functions,
|
||||
temporaryChatEnabled
|
||||
} from '$lib/stores';
|
||||
|
||||
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
|
||||
@ -40,6 +41,7 @@
|
||||
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
|
||||
import AccountPending from '$lib/components/layout/Overlay/AccountPending.svelte';
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@ -177,6 +179,10 @@
|
||||
showChangelog.set(localStorage.version !== $config.version);
|
||||
}
|
||||
|
||||
if ($page.url.searchParams.get('temporary-chat') === 'true') {
|
||||
temporaryChatEnabled.set(true);
|
||||
}
|
||||
|
||||
await tick();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user