Skip to content
Snippets Groups Projects
Commit d4b3e5ae authored by Jonas Zohren's avatar Jonas Zohren :speech_balloon:
Browse files

Use query parameter instead of hash to select dialog

parent 13020b60
No related branches found
No related tags found
Loading
Pipeline #16990 passed
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment