fix: postform crash

This commit is contained in:
Xylight committed 2024-11-01 10:32:06 -07:00
1 parent 2b27e99784
commit 3ebb46e37d
3 files changed
+17 -21

No files matched your search

@@ -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}
<ObjectAutocomplete
bind:q={communitySearch}
bind:items={communities}
items={communities}
jwt={$profile?.jwt}
listing_type="All"
label={$t('form.post.community')}
@@ -301,8 +301,8 @@
>
{#snippet prefix()}
<Avatar
url={data.community.icon}
alt={data.community.name}
url={data?.community?.icon}
alt={data.community?.name}
width={24}
/>
{/snippet}
+1 -1
View File
@@ -53,7 +53,7 @@
id = generateID(),
inlineAffixes = false,
shadow = 'none',
element = $bindable(undefined),
element = $bindable(),
class: clazz = '',
customLabel,
prefix,
+12 -16
View File
@@ -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()
}
})
}
</script>