Co-Authored-By: G30 <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2026-09-19 17:26:40 -04:00
co-authored by G30
parent 10d1cfe637
commit 67adde3193
3 changed files with 11 additions and 7 deletions
+7 -3
View File
@@ -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();
+2 -2
View File
@@ -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);
}
};
+2 -2
View File
@@ -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`)}