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 5, 2024
1 parent af3a622 commit 7829542
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 @@ -134,7 +134,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 7829542

Please sign in to comment.