🐛 fixed reload error
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
5d829273da
commit
0adc35176b
2 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
import AnswerBox from "../../../components/form/answerbox/AnswerBox.svelte";
|
||||
import Footer from "../../../components/form/footer/Footer.svelte";
|
||||
import { onMount } from "svelte"
|
||||
import { browser } from "$app/environment";
|
||||
|
||||
export let data;
|
||||
|
||||
|
@ -12,7 +13,7 @@
|
|||
let questionNumber: number = 0
|
||||
|
||||
// Reactive statement to react on 'data.slug' changes
|
||||
$: if (data && data.slug !== undefined) {
|
||||
$: if (data && data.slug !== undefined && browser) {
|
||||
questionNumber = data.slug;
|
||||
updateQuestionData();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { error } from "@sveltejs/kit";
|
||||
|
||||
/** @type {import('./$types').PageServerLoad} */
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load({ params }) {
|
||||
let questionNumber = params;
|
||||
|
Reference in a new issue