mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-26 17:30:27 -04:00
refac
Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
co-authored by
G30
parent
10d1cfe637
commit
67adde3193
@@ -2033,6 +2033,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($page.url.searchParams.get('temporary-chat') === 'true') {
|
||||
await temporaryChatEnabled.set(true);
|
||||
}
|
||||
|
||||
if ($user?.role !== 'admin' && !$user?.permissions?.chat?.temporary) {
|
||||
await temporaryChatEnabled.set(false);
|
||||
}
|
||||
@@ -2133,7 +2137,7 @@
|
||||
await showArtifacts.set(false);
|
||||
|
||||
if (!embedded && $page.url.pathname.includes('/c/')) {
|
||||
window.history.replaceState(history.state, '', `/`);
|
||||
window.history.replaceState(window.history.state, '', `/`);
|
||||
}
|
||||
|
||||
autoScroll = true;
|
||||
@@ -3672,7 +3676,7 @@
|
||||
});
|
||||
await chatId.set(res.chat_id);
|
||||
if (!$temporaryChatEnabled && !embedded) {
|
||||
window.history.replaceState(history.state, '', `/c/${res.chat_id}`);
|
||||
window.history.replaceState(window.history.state, '', `/c/${res.chat_id}`);
|
||||
await refreshChatList(localStorage.token);
|
||||
|
||||
// Persist chat-level params (system prompt, advanced
|
||||
@@ -3958,7 +3962,7 @@
|
||||
await chatId.set(_chatId);
|
||||
|
||||
if (!embedded) {
|
||||
window.history.replaceState(history.state, '', `/c/${_chatId}`);
|
||||
window.history.replaceState(window.history.state, '', `/c/${_chatId}`);
|
||||
}
|
||||
|
||||
await tick();
|
||||
|
||||
@@ -579,9 +579,9 @@
|
||||
}
|
||||
|
||||
if ($temporaryChatEnabled) {
|
||||
window.history.replaceState(null, '', '?temporary-chat=true');
|
||||
window.history.replaceState(window.history.state, '', '?temporary-chat=true');
|
||||
} else {
|
||||
window.history.replaceState(null, '', location.pathname);
|
||||
window.history.replaceState(window.history.state, '', location.pathname);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -184,9 +184,9 @@
|
||||
|
||||
// add 'temporary-chat=true' to the URL
|
||||
if ($temporaryChatEnabled) {
|
||||
window.history.replaceState(null, '', '?temporary-chat=true');
|
||||
window.history.replaceState(window.history.state, '', '?temporary-chat=true');
|
||||
} else {
|
||||
window.history.replaceState(null, '', location.pathname);
|
||||
window.history.replaceState(window.history.state, '', location.pathname);
|
||||
}
|
||||
}}
|
||||
aria-label={$i18n.t(`Temporary Chat`)}
|
||||
|
||||
Reference in New Issue
Block a user