File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ export async function useUpdateStoresFromQuery() {
1515 const query = Object . fromEntries ( urlParameters as unknown as Iterable < [ string , string ] > ) ;
1616 try {
1717 if ( query . shareable ) {
18- const json = decodeURIComponent ( atob ( query . shareable ) ) ;
18+ const rawJson = atob ( query . shareable . replace ( / _ / g, '/' ) . replace ( / - / g, '+' ) ) ;
19+ const json = rawJson . startsWith ( '%' ) ? decodeURIComponent ( rawJson ) : rawJson ;
1920 const {
2021 modules : queryModules ,
2122 options : queryOptions ,
@@ -104,7 +105,7 @@ export function useSyncQueryWithStores() {
104105 options
105106 } ) ;
106107
107- parameters . shareable = btoa ( encodeURIComponent ( json ) ) ;
108+ parameters . shareable = btoa ( json ) . replace ( / \/ / g , '_' ) . replace ( / \+ / g , '-' ) ;
108109 const queryString = Object . keys ( parameters )
109110 . map ( key => `${ key } =${ parameters [ key ] } ` )
110111 . join ( '&' ) ;
You can’t perform that action at this time.
0 commit comments