Skip to content

Commit

Permalink
Use history.replaceState instead of setting location.hash (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik authored Dec 23, 2024
1 parent c1312c4 commit 950dc7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state/fragment-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function buildUrlForStateParams(state: State) {//partialState: {params: S
return `${location.protocol}//${location.host}${location.pathname}#${encodeStateParamsAsFragment(state)}`;
}
export async function writeStateInFragment(state: State) {
window.location.hash = await encodeStateParamsAsFragment(state);
history.replaceState(state, '', '#' + await encodeStateParamsAsFragment(state));
}
async function compressString(input: string): Promise<string> {
return btoa(String.fromCharCode(...new Uint8Array(await new Response(new ReadableStream({
Expand Down

0 comments on commit 950dc7e

Please sign in to comment.