fix: ssr always off even when enabled

This commit is contained in:
James Xylight committed 2025-08-31 11:34:08 -07:00
1 parent 0f3c316d2c
commit 8d3ec68160
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -1,8 +1,9 @@
import { browser } from '$app/environment'
import { settings } from '$lib/settings.svelte'
import { aliases, loadTranslations } from '$lib/i18n/translations.js'
import { env } from '$env/dynamic/public'
export const ssr = false
export const ssr = env.PUBLIC_SSR_ENABLED?.toLowerCase() == 'true'
export const load = async () => {
if (browser) {
+3
View File
@@ -1,3 +1,4 @@
import { env } from '$env/dynamic/public'
import { t } from '$lib/i18n/translations.js'
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
import { ReactiveState, awaitIfServer } from '$lib/promise.svelte.js'
@@ -26,6 +27,8 @@ export async function load({ url, fetch }) {
fetch: fetch,
})
if (env.PUBLIC_SSR_ENABLED?.toLowerCase() == 'true') await feed
return {
feed: new ReactiveState((await awaitIfServer(feed)).data),
filters: new ReactiveState({