From d4b3e5aeb02db376fbd46b342b495caedab5561e Mon Sep 17 00:00:00 2001 From: Jonas <jonas.zohren@tu-dortmund.de> Date: Wed, 10 Mar 2021 18:48:30 +0100 Subject: [PATCH] Use query parameter instead of hash to select dialog --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index f314da6..1e9395b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -18,15 +18,15 @@ function isValidDialogSetName(input: unknown) { return !/[^a-zA-Z0-9\-\_]/i.test(input); } -function getHashValue(): string { - return window.location.hash.substr(1); +function getParamValue(paramName: string): string | null { + return new URLSearchParams(window.location.search).get(paramName); } /** * Fetch a dialogSet based on the hash value */ export async function fetchDialogSet(): Promise<DialogSet> { - const setName = getHashValue(); + const setName = getParamValue("dialogSet"); if (!isValidDialogSetName(setName)) throw new Error("Name is not valid dialogSet name"); -- GitLab