From f8a5bc3c2e6fad624a8c69ff51cc04bdcd75f3d6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 3 Dec 2026 01:53:04 +0400 Subject: [PATCH] refac --- src/lib/components/chat/SettingsModal.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 5a672dcbcc..607871d5cd 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -7,7 +7,7 @@ } from '$lib/utils/settings-search'; import { browser } from '$app/environment'; import { beforeNavigate } from '$app/navigation'; - import { getContext, tick } from 'svelte'; + import { getContext, onMount, tick } from 'svelte'; import type { Writable } from 'svelte/store'; import { toast } from 'svelte-sonner'; import { config, mobile, settings, sidebarWidth, user, visibleControls } from '$lib/stores'; @@ -37,6 +37,12 @@ // Called with the open tab whenever it changes, so the page address can follow it. export let onTabChange: (tab: string) => void = () => {}; let modalShow = false; + // The layout mounts this on first open, already open; showing the dialog only once mounted + // lets its opening animation play then too. + let mounted = false; + onMount(() => { + mounted = true; + }); let lastShow: boolean | string | SettingsModalRequest = false; let tabState: Record | null = null; let personalUiSettings: Record = {}; @@ -651,7 +657,7 @@ containerClassName="p-0 [scrollbar-gutter:auto]!" className="h-[100dvh] flex flex-col md:flex-row bg-base-0 dark:bg-base-900 border-0! overflow-hidden" ariaLabel={$i18n.t('Settings')} - bind:show={modalShow} + show={modalShow && mounted} onRequestClose={close} >