From 9b2a41ad6818c9ba9c460385bed7703b277d7bb0 Mon Sep 17 00:00:00 2001 From: Pedro Carreno <34664891+Pkcarreno@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:18:20 -0400 Subject: [PATCH] fix: improve url compatibility --- src/features/editor/api/query-storage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/editor/api/query-storage.ts b/src/features/editor/api/query-storage.ts index e71555b..6e8f9f3 100644 --- a/src/features/editor/api/query-storage.ts +++ b/src/features/editor/api/query-storage.ts @@ -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 = { @@ -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 => {