Editor: fix decode deeplink data

This commit is contained in:
Viktor Fomin 2023-12-14 13:19:22 +03:00
parent a8038e4dca
commit d4a5e22447

View File

@ -62,6 +62,11 @@ function DeepLinker(options) {
}; };
} }
function bytesToBase64(bytes) {
const binString = String.fromCodePoint(...bytes);
return btoa(binString);
}
export const getDeepLink = ( export const getDeepLink = (
location, location,
email, email,
@ -84,9 +89,8 @@ export const getDeepLink = (
}, },
originalUrl: originalUrl, originalUrl: originalUrl,
}; };
const deepLinkData = window.btoa( const stringifyData = JSON.stringify(jsonData);
encodeURIComponent(JSON.stringify(jsonData)) const deepLinkData = bytesToBase64(new TextEncoder().encode(stringifyData));
);
const linker = new DeepLinker({ const linker = new DeepLinker({
onIgnored: function () { onIgnored: function () {