Skip to content

Commit

Permalink
fix: problem with url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Sep 24, 2024
1 parent 0c663f9 commit a95b5ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/js/ui/views/session-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default (): m.Component<SessionGridProps> => {
icon: 'exit',
intend: 'primary',
size: 'sm',
onClick: () => window.open(`${location.href}?gridName=${state.selectedGrid}`, '_blank'),
onClick: () => window.open(`${location.href}?gridName=${encodeURIComponent(state.selectedGrid)}`, '_blank'),
}),
),
m(
Expand All @@ -155,7 +155,7 @@ export default (): m.Component<SessionGridProps> => {
intend: 'primary',
size: 'sm',
onClick: () => {
API.exec<string>(API.GET_LOCAL_URL, `/${location.hash}?gridName=${state.selectedGrid}`).then((url) => {
API.exec<string>(API.GET_LOCAL_URL, `/${location.hash}?gridName=${encodeURIComponent(state.selectedGrid)}`).then((url) => {
console.log(url);
if (inElectron) {
shell.openExternal(url);
Expand Down Expand Up @@ -369,9 +369,11 @@ export default (): m.Component<SessionGridProps> => {
},
view({ attrs }) {
if (attrs.gridName) {
state.selectedGrid = decodeURI(attrs.gridName);
state.selectedGrid = decodeURIComponent(attrs.gridName);
state.minimalMode = true;

console.log(attrs.gridName);

document.title = `${state.selectedGrid} - Session Grid`;
}

Expand Down

0 comments on commit a95b5ba

Please sign in to comment.