Skip to content

Commit

Permalink
browser check
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Nov 16, 2024
1 parent dc4b164 commit 8a1ce49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/routes/(app)/documents/[id]-[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<script lang="ts">
import "@/style/kit.css";
import { browser } from "$app/environment";
import { embedUrl } from "$lib/api/embed";
import * as documents from "$lib/api/documents";
Expand All @@ -16,7 +18,9 @@
$: document = data.document;
$: mode = data.mode;
$: text = documents.text(document);
$: text = browser
? documents.text(document)
: Promise.resolve({ pages: [], updated: 0 });
$: asset_url = data.asset_url;
$: canonical_url = documents.canonicalUrl(document).href;
Expand Down
3 changes: 0 additions & 3 deletions src/routes/(app)/documents/[id]-[slug]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import { breadcrumbTrail } from "$lib/utils/index";
import loadDocument from "$lib/load/document";
import { getQuery } from "$lib/utils/search";

// just for testing
export const ssr = false;

/** @type {import('./$types').PageLoad} */
export async function load({ fetch, params, parent, depends, url }) {
const { document, text, asset_url, mode } = await loadDocument({
Expand Down

0 comments on commit 8a1ce49

Please sign in to comment.