Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix params encoding #251

Merged
merged 3 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strong-dolphins-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@codeimage/app': patch
---

fix: fix query param conversion base64
2 changes: 1 addition & 1 deletion apps/codeimage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.17.0",
"scripts": {
"start": "vite",
"dev": "vite --host",
"dev": "vite --port=4201 --host",
"build": "rimraf dist && vite build",
"build-sw": "rimraf dist && cross-env BASE_URL=/ SW=true SOURCE_MAP=true RELOAD_SW=true vite build",
"serve:https": "serve dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function connectStoreWithQueryParams() {

if (data) {
try {
const params = JSON.parse(window.atob(data));
const params = JSON.parse(decodeURIComponent(window.atob(data)));
if (params) {
if (params.terminal) {
updateTerminalStore(state => ({...state, ...params.terminal}));
Expand Down Expand Up @@ -74,7 +74,7 @@ export function connectStoreWithQueryParams() {
)
.subscribe(state => {
const params = {
p: window.btoa(JSON.stringify(state)),
p: window.btoa(encodeURIComponent(JSON.stringify(state))),
};
setSearchParams(params, {
scroll: false,
Expand Down
Loading