fix: ssr crash

This commit is contained in:
James Xylight committed 2025-02-06 16:19:55 -08:00
1 parent 97b6a592d6
commit dd07caf5c4
4 files changed
+15 -14

No files matched your search

+11 -11
View File
@@ -76,19 +76,11 @@
top: number
bottom: number
class: string
}>()
}>(contentPadding)
let dockPropsStore = writable<{
noGap: boolean
top: boolean
}>()
$effect.root(() => {
$effect(() => {
contentPaddingStore.set(contentPadding)
dockPropsStore.set(
calculateDockProperties(settings.dock, innerWidth.current ?? 1000),
)
})
})
}>(dockProps)
export { contentPaddingStore as contentPadding, dockPropsStore as dockProps }
</script>
@@ -97,10 +89,11 @@
import { settings } from '$lib/settings.svelte.js'
import { themeVars } from '$lib/ui/colors'
import { writable, type Readable, type Writable } from 'svelte/store'
import type { ClassValue } from 'svelte/elements'
interface Props {
route?: { id: string | null } | undefined
class?: string
class?: ClassValue
children?: import('svelte').Snippet
navbar?: import('svelte').Snippet<[any]>
sidebar?: import('svelte').Snippet<[any]>
@@ -124,6 +117,13 @@
calculatePadding(dockProps.noGap, dockProps.top, false),
)
let topPanel = $derived(dockProps.noGap && dockProps.top)
$effect(() => {
contentPaddingStore.set(contentPadding)
dockPropsStore.set(
calculateDockProperties(settings.dock, innerWidth.current ?? 1000),
)
})
</script>
<svelte:window bind:innerWidth={$screenWidth} />
@@ -30,7 +30,7 @@
}: Props = $props()
let isSelected = $derived(isSelectedFilter(page.url.pathname))
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
let isPanel = $derived(adaptive ? $dockProps?.noGap : false)
</script>
<Button
+2 -1
View File
@@ -25,11 +25,12 @@
import { LINKED_INSTANCE_URL } from '$lib/instance'
import { t } from '$lib/translations'
import CommandsWrapper from './commands/CommandsWrapper.svelte'
import type { ClassValue } from 'svelte/elements'
let promptOpen: boolean = $state(false)
interface Props {
style?: string
class?: string
class?: ClassValue
}
let { style = '', class: clazz = '' }: Props = $props()