fix: ssr crash
This commit is contained in:
1 parent
97b6a592d6
commit
dd07caf5c4
4 files changed
+15
-14
No files matched your search
@@ -76,19 +76,11 @@
|
|||||||
top: number
|
top: number
|
||||||
bottom: number
|
bottom: number
|
||||||
class: string
|
class: string
|
||||||
}>()
|
}>(contentPadding)
|
||||||
let dockPropsStore = writable<{
|
let dockPropsStore = writable<{
|
||||||
noGap: boolean
|
noGap: boolean
|
||||||
top: boolean
|
top: boolean
|
||||||
}>()
|
}>(dockProps)
|
||||||
$effect.root(() => {
|
|
||||||
$effect(() => {
|
|
||||||
contentPaddingStore.set(contentPadding)
|
|
||||||
dockPropsStore.set(
|
|
||||||
calculateDockProperties(settings.dock, innerWidth.current ?? 1000),
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
export { contentPaddingStore as contentPadding, dockPropsStore as dockProps }
|
export { contentPaddingStore as contentPadding, dockPropsStore as dockProps }
|
||||||
</script>
|
</script>
|
||||||
@@ -97,10 +89,11 @@
|
|||||||
import { settings } from '$lib/settings.svelte.js'
|
import { settings } from '$lib/settings.svelte.js'
|
||||||
import { themeVars } from '$lib/ui/colors'
|
import { themeVars } from '$lib/ui/colors'
|
||||||
import { writable, type Readable, type Writable } from 'svelte/store'
|
import { writable, type Readable, type Writable } from 'svelte/store'
|
||||||
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
route?: { id: string | null } | undefined
|
route?: { id: string | null } | undefined
|
||||||
class?: string
|
class?: ClassValue
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
navbar?: import('svelte').Snippet<[any]>
|
navbar?: import('svelte').Snippet<[any]>
|
||||||
sidebar?: import('svelte').Snippet<[any]>
|
sidebar?: import('svelte').Snippet<[any]>
|
||||||
@@ -124,6 +117,13 @@
|
|||||||
calculatePadding(dockProps.noGap, dockProps.top, false),
|
calculatePadding(dockProps.noGap, dockProps.top, false),
|
||||||
)
|
)
|
||||||
let topPanel = $derived(dockProps.noGap && dockProps.top)
|
let topPanel = $derived(dockProps.noGap && dockProps.top)
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
contentPaddingStore.set(contentPadding)
|
||||||
|
dockPropsStore.set(
|
||||||
|
calculateDockProperties(settings.dock, innerWidth.current ?? 1000),
|
||||||
|
)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window bind:innerWidth={$screenWidth} />
|
<svelte:window bind:innerWidth={$screenWidth} />
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
let isSelected = $derived(isSelectedFilter(page.url.pathname))
|
let isSelected = $derived(isSelectedFilter(page.url.pathname))
|
||||||
let isPanel = $derived(adaptive ? $dockProps.noGap : false)
|
let isPanel = $derived(adaptive ? $dockProps?.noGap : false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -25,11 +25,12 @@
|
|||||||
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import CommandsWrapper from './commands/CommandsWrapper.svelte'
|
import CommandsWrapper from './commands/CommandsWrapper.svelte'
|
||||||
|
import type { ClassValue } from 'svelte/elements'
|
||||||
|
|
||||||
let promptOpen: boolean = $state(false)
|
let promptOpen: boolean = $state(false)
|
||||||
interface Props {
|
interface Props {
|
||||||
style?: string
|
style?: string
|
||||||
class?: string
|
class?: ClassValue
|
||||||
}
|
}
|
||||||
|
|
||||||
let { style = '', class: clazz = '' }: Props = $props()
|
let { style = '', class: clazz = '' }: Props = $props()
|
||||||
|
|||||||
@@ -130,6 +130,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<CommentListVirtualizer
|
<CommentListVirtualizer
|
||||||
post={post.post_view.post}
|
post={post.post_view.post}
|
||||||
bind:nodes={tree}
|
nodes={tree}
|
||||||
scrollTo={focus}
|
scrollTo={focus}
|
||||||
/>
|
/>
|
||||||
Reference in new issue
Block a user