URL decode before using control API

This commit is contained in:
Leo Vasanko 2023-11-03 21:59:44 +00:00
parent 225f2b0651
commit d3f584b738

View File

@ -125,7 +125,7 @@ const rename = (doc: FolderDocument, newName: string) => {
control.send( control.send(
JSON.stringify({ JSON.stringify({
op: 'rename', op: 'rename',
path: `${linkBasePath.value}/${oldName}`, path: `${decodeURIComponent(linkBasePath.value)}/${oldName}`,
to: newName to: newName
}) })
) )
@ -149,7 +149,7 @@ const mkdir = (doc: FolderDocument, name: string) => {
const msg = JSON.parse(ev.data) const msg = JSON.parse(ev.data)
if ('error' in msg) { if ('error' in msg) {
console.error('Mkdir failed', msg.error.message, msg.error) console.error('Mkdir failed', msg.error.message, msg.error)
doc.name = oldName editing.value = null
} else { } else {
console.log('mkdir', msg) console.log('mkdir', msg)
} }
@ -158,7 +158,7 @@ const mkdir = (doc: FolderDocument, name: string) => {
control.send( control.send(
JSON.stringify({ JSON.stringify({
op: 'mkdir', op: 'mkdir',
path: `${linkBasePath.value}/${name}`, path: `${decodeURIComponent(linkBasePath.value)}/${name}`,
}) })
) )
} }