From 8aaf7e201e58ec9ecb431a6ac05e07d0078b12b0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 9 Sep 2022 15:35:48 +0200 Subject: pref format changed --- client-web/source/preferences.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client-web/source/preferences.ts') diff --git a/client-web/source/preferences.ts b/client-web/source/preferences.ts index c25cece..b47956b 100644 --- a/client-web/source/preferences.ts +++ b/client-web/source/preferences.ts @@ -25,17 +25,17 @@ export function register_prefs>>(ds: return p } -const raw_params = load_query_params(); -export function load_query_params(): { [key: string]: string } { - const q: { [key: string]: string } = {} - const params = window.location.hash.substring(1).split("?")[1] - if (!params) return {} +const raw_params = load_params().p; +export function load_params(): { p: { [key: string]: string }, rname: string } { + const q: Record = {} + const [rname, params] = window.location.hash.substring(1).split("?") + if (!params) return { rname, p: {} } for (const kv of params.split("&")) { const [key, value] = kv.split("=") if (key == "prototype") continue q[decodeURIComponent(key)] = decodeURIComponent(value) } - return q + return { p: q, rname } } export function get_param(ty: string, key: string): T | undefined { -- cgit v1.2.3-70-g09d2