fix: after creating a folder named %1, the "enter folder" link didn't work

Massimo Melina committed Jun 10, 2024 at 00:00 UTC ca76fb1f2461bca09e1853eed1ba6a9240efbfa2
1 file changed +7 -4
frontend/src/upload.ts
+7 -4
@@ -485,10 +485,13 @@ async function createFolder() {
485 await alertDialog(h(() =>
486 h(FlexV, {},
487 h('div', {}, t`Successfully created`),
488 - h(Link, { to: uri + name + '/', onClickCapture() { // "capture" because dialogs must be closed (popping from history) before we push a new state in the history
489 - closeDialog()
490 - closeDialog()
491 - } }, t('enter_folder', "Enter the folder")),
488 + h(Link, {
489 + to: uri + encodeURIComponent(name) + '/',
490 + onClickCapture() { // "capture" because dialogs must be closed (popping from history) before we push a new state in the history
491 + closeDialog()
492 + closeDialog()
493 + }
494 + }, t('enter_folder', "Enter the folder")),
495 )))
496 }
497 catch(e: any) {