diff --git a/src/lib/components/lemmy/post/form/PostForm.svelte b/src/lib/components/lemmy/post/form/PostForm.svelte index 6b16020d..e5d4e567 100644 --- a/src/lib/components/lemmy/post/form/PostForm.svelte +++ b/src/lib/components/lemmy/post/form/PostForm.svelte @@ -52,7 +52,7 @@ nsfw: boolean loading: boolean alt_text?: string - language_id?: number + language_id?: number | string } formtitle?: import('svelte').Snippet } @@ -273,7 +273,7 @@ {#if !data.community} {#snippet prefix()} {/snippet} diff --git a/src/lib/mono/forms/TextInput.svelte b/src/lib/mono/forms/TextInput.svelte index 1820e5d9..a7a51eee 100644 --- a/src/lib/mono/forms/TextInput.svelte +++ b/src/lib/mono/forms/TextInput.svelte @@ -53,7 +53,7 @@ id = generateID(), inlineAffixes = false, shadow = 'none', - element = $bindable(undefined), + element = $bindable(), class: clazz = '', customLabel, prefix, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index b61b9c97..413c9221 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -48,22 +48,6 @@ showSpinner: false, }) - let barTimeout: any = $state(0) - - run(() => { - if (browser) { - if ($navigating) { - document.body.classList.toggle('wait', true) - barTimeout = setTimeout(() => nProgress.start(), 100) - } - if (!$navigating) { - document.body.classList.toggle('wait', false) - clearTimeout(barTimeout) - nProgress.done() - } - } - }) - onMount(() => { if (browser) { if (window.location.hash == 'main') { @@ -81,6 +65,7 @@ }) if (browser) { + let barTimeout: number = $state(0) $effect(() => { if (settings) { document.body.classList.remove( @@ -101,6 +86,17 @@ ) } }) + + navigating.subscribe((value) => { + if (value) { + document.body.classList.toggle('wait', true) + barTimeout = setTimeout(() => nProgress.start(), 100) + } else { + document.body.classList.toggle('wait', false) + clearTimeout(barTimeout) + nProgress.done() + } + }) }