Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ssr with nodekey param #122

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/routes/devices.html/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import { onMount } from 'svelte';
import { fade } from 'svelte/transition';

let newDeviceKey = $page.url.searchParams.get('nodekey') ?? '';
let newDeviceKey = '';

let newDeviceCardVisible = newDeviceKey.length > 0 ? true : false;
let newDeviceCardVisible = false;

//
// Component Variables
Expand All @@ -25,6 +25,11 @@
// We define the meat of our script in onMount as doing so forces client side rendering.
// Doing so also does not perform any actions until components are initialized
onMount(async () => {

// Handle nodekey
newDeviceKey = $page.url.searchParams.get('nodekey') ?? ''
newDeviceCardVisible = newDeviceKey.length > 0 ? true : false

// update user list
getUsers();
// attempt to pull list of devices
Expand Down