feat: temp chat as default

This commit is contained in:
Timothy Jaeryang Baek
2025-08-20 22:49:05 +04:00
parent ba972ecd52
commit 19e82ace23
5 changed files with 43 additions and 41 deletions
+8 -1
View File
@@ -115,8 +115,15 @@
class="flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
id="temporary-chat-button"
on:click={async () => {
temporaryChatEnabled.set(!$temporaryChatEnabled);
if (($settings?.temporaryChatByDefault ?? false) && $temporaryChatEnabled) {
// for proper initNewChat handling
temporaryChatEnabled.set(null);
} else {
temporaryChatEnabled.set(!$temporaryChatEnabled);
}
await goto('/');
// add 'temporary-chat=true' to the URL
if ($temporaryChatEnabled) {
window.history.replaceState(null, '', '?temporary-chat=true');