Skip to content

Commit

Permalink
fix: decoding file URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi committed Sep 9, 2024
1 parent 57c18a8 commit d127ab2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const FilePreview = ({
className={className}
sx={theme => ({
position: 'relative',
background: `${image ? `url(${url})` : `${theme.palette.grey[100]}`}`,
background: `${image ? `url("${url}")` : `${theme.palette.grey[100]}`}`,
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const EditFileForm = ({
className="block m-auto pb-40 sm:pb-50"
width="180px"
height="100%"
src={url}
src={decodeURI(url)}
alt="preview"
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const PostForm = ({
mimeType: '',
});
}
if (value) setValue(`files.${fieldIndex}.url`, encodeURI(value));
if (value) setValue(`files.${fieldIndex}.url`, decodeURI(value));
if (mimeType) setValue(`files.${fieldIndex}.mimeType`, mimeType);
if (name) setValue(`files.${fieldIndex}.name`, name);
if (iri) setValue(`files.${fieldIndex}.iri`, iri);
Expand Down

0 comments on commit d127ab2

Please sign in to comment.