From a95b5baf00195be23d31ad30108769e7b87b9057 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Tue, 24 Sep 2024 20:49:37 +0200 Subject: [PATCH] fix: problem with url encoding --- frontend/src/js/ui/views/session-grid.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/js/ui/views/session-grid.ts b/frontend/src/js/ui/views/session-grid.ts index ff105f2..5fe8a76 100644 --- a/frontend/src/js/ui/views/session-grid.ts +++ b/frontend/src/js/ui/views/session-grid.ts @@ -144,7 +144,7 @@ export default (): m.Component => { 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( @@ -155,7 +155,7 @@ export default (): m.Component => { intend: 'primary', size: 'sm', onClick: () => { - API.exec(API.GET_LOCAL_URL, `/${location.hash}?gridName=${state.selectedGrid}`).then((url) => { + API.exec(API.GET_LOCAL_URL, `/${location.hash}?gridName=${encodeURIComponent(state.selectedGrid)}`).then((url) => { console.log(url); if (inElectron) { shell.openExternal(url); @@ -369,9 +369,11 @@ export default (): m.Component => { }, 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`; }