Skip to content

Commit a9db179

Browse files
authored
fix ssr with nodekey param (#122)
1 parent 1f73a7b commit a9db179

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/routes/devices.html/+page.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import { onMount } from 'svelte';
1212
import { fade } from 'svelte/transition';
1313
14-
let newDeviceKey = $page.url.searchParams.get('nodekey') ?? '';
14+
let newDeviceKey = '';
1515
16-
let newDeviceCardVisible = newDeviceKey.length > 0 ? true : false;
16+
let newDeviceCardVisible = false;
1717
1818
//
1919
// Component Variables
@@ -25,6 +25,11 @@
2525
// We define the meat of our script in onMount as doing so forces client side rendering.
2626
// Doing so also does not perform any actions until components are initialized
2727
onMount(async () => {
28+
29+
// Handle nodekey
30+
newDeviceKey = $page.url.searchParams.get('nodekey') ?? ''
31+
newDeviceCardVisible = newDeviceKey.length > 0 ? true : false
32+
2833
// update user list
2934
getUsers();
3035
// attempt to pull list of devices

0 commit comments

Comments
 (0)