diff --git a/src/utils.ts b/src/utils.ts index f314da677f79367e07a7da4aff646694337f00ea..1e9395bbba58f21afe243c0c55c78093f0589074 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");