Skip to content

Commit

Permalink
fix: improve url compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Pkcarreno committed Jun 5, 2024
1 parent 9a19847 commit 9b2a41a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/editor/api/query-storage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decode, encode } from 'js-base64';
import { decode, encodeURI } from 'js-base64';
import type { StateStorage } from 'zustand/middleware';

export const queryStorage: StateStorage = {
Expand All @@ -9,7 +9,7 @@ export const queryStorage: StateStorage = {
},
setItem: (key, newValue): void => {
const searchParams = new URLSearchParams(location.hash.slice(1));
searchParams.set(key, encode(JSON.stringify(newValue)));
searchParams.set(key, encodeURI(JSON.stringify(newValue)));
location.hash = searchParams.toString();
},
removeItem: (key): void => {
Expand Down

0 comments on commit 9b2a41a

Please sign in to comment.