Skip to content
Snippets Groups Projects
Commit 5147908d authored by Leonardo Christino's avatar Leonardo Christino
Browse files

fix(url): sync saveID as a URL query param

parent e1c5f3a4
No related branches found
Tags v1.70.1
No related merge requests found
Pipeline #129337 passed
export enum URLParams {
saveState = 'saveState',
}
export function getParam(param: URLParams) {
const query = new URLSearchParams(window.location.search);
return query.get(param);
}
export function setParam(param: URLParams, value: string | undefined) {
const query = new URLSearchParams(window.location.search);
if (!value) {
deleteParam(param);
} else {
query.set(param, value);
history.pushState(null, '', '?' + query.toString());
}
}
export function deleteParam(param: URLParams) {
const query = new URLSearchParams(window.location.search);
query.delete(param);
history.pushState(null, '', '?' + query.toString());
}
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