Skip to content

Commit

Permalink
Fix trailing slash issue
Browse files Browse the repository at this point in the history
Fixes #810
  • Loading branch information
underbluewaters committed Sep 9, 2024
1 parent 374fed3 commit 7db1dce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/client/src/projects/Forums/FileUploadItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function ImageDisplayModal({
<img
onLoad={onImageLoaded}
onClick={(e) => e.stopPropagation()}
src={fileUpload.downloadUrl + "/public"}
src={fileUpload.downloadUrl.replace(/\/$/, "") + "/public"}
alt={fileUpload.filename}
className="w-auto h-auto max-w-full max-h-full"
/>
Expand All @@ -231,7 +231,8 @@ export function ImageDisplayModal({
onClick={async (e) => {
e.preventDefault();
e.stopPropagation();
const imageSrc = fileUpload.downloadUrl + "/public";
const imageSrc =
fileUpload.downloadUrl.replace(/\/$/, "") + "/public";
const image = await fetch(imageSrc);
const imageBlog = await image.blob();
const imageURL = URL.createObjectURL(imageBlog);
Expand Down

0 comments on commit 7db1dce

Please sign in to comment.