This commit is contained in:
Timothy Jaeryang Baek
2025-06-09 00:53:16 +04:00
parent c59b4cf379
commit 7969d8e8f3
4 changed files with 24 additions and 20 deletions
+6
View File
@@ -438,6 +438,12 @@
window.addEventListener('message', onMessageHandler);
$socket?.on('chat-events', chatEventHandler);
page.subscribe((page) => {
if (page.url.pathname === '/') {
initNewChat();
}
});
if (!$chatId) {
chatIdUnsubscriber = chatId.subscribe(async (value) => {
if (!value) {
@@ -237,7 +237,11 @@
bind:show={showMenu}
model={item.model}
toggleSidebarHandler={() => {
pinnedModels.set([...new Set([...$pinnedModels, item.model.id])]);
if ($pinnedModels.includes(item.model.id)) {
pinnedModels.set($pinnedModels.filter((id) => id !== item.model.id));
} else {
pinnedModels.set([...new Set([...$pinnedModels, item.model.id])]);
}
}}
copyLinkHandler={() => {
copyLinkHandler(item.model);
@@ -38,15 +38,16 @@
</DropdownMenu.Trigger>
<DropdownMenu.Content
strategy="fixed"
class="w-full max-w-[180px] text-sm rounded-xl px-1 py-1.5 z-[9999999] bg-white dark:bg-gray-850 dark:text-white shadow-lg"
sideOffset={-2}
side="bottom"
align="start"
align="end"
transition={flyAndScale}
>
<DropdownMenu.Item
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition items-center gap-2"
on:click={() => {
on:click={(e) => {
toggleSidebarHandler();
}}
>