Skip to content

Commit

Permalink
fix: thumbnail URI encoding (#618)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Helm <[email protected]>
Co-authored-by: Pedro Lamas <[email protected]>
  • Loading branch information
bhelm and pedrolamas authored Mar 31, 2022
1 parent 25536cb commit 30efd5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const getThumb = (thumbnails: Thumbnail[], path: string, large = true) =>
if (thumb.relative_path && thumb.relative_path.length > 0) {
const url = new URL(apiUrl ?? document.location.origin)
url.pathname = (path === '')
? `/server/files/gcodes/${thumb.relative_path}`
: `/server/files/gcodes/${path}/${thumb.relative_path}`
? `/server/files/gcodes/${encodeURI(thumb.relative_path)}`
: `/server/files/gcodes/${encodeURI(path)}/${encodeURI(thumb.relative_path)}`

return {
...thumb,
Expand Down

0 comments on commit 30efd5f

Please sign in to comment.