Network: Do not consider page parameters if not running in the browser

In preparation for SSR
This commit is contained in:
Alessandro Pignotti 2024-10-15 17:22:32 +02:00
parent d28c611806
commit 208cfa8e0d

View file

@ -1,8 +1,14 @@
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import { browser } from '$app/environment'
let params = new URLSearchParams("?"+window.location.hash.substr(1)); let authKey = undefined;
let authKey = params.get("authKey") || undefined; let controlUrl = undefined;
let controlUrl = params.get("controlUrl") || undefined; if(browser)
{
let params = new URLSearchParams("?"+window.location.hash.substr(1));
authKey = params.get("authKey");
controlUrl = params.get("controlUrl");
}
let dashboardUrl = controlUrl ? null : "https://login.tailscale.com/admin/machines"; let dashboardUrl = controlUrl ? null : "https://login.tailscale.com/admin/machines";
let resolveLogin = null; let resolveLogin = null;
let loginPromise = new Promise((f,r) => { let loginPromise = new Promise((f,r) => {