Skip to content

Commit

Permalink
fix: fix file name truncation if it has spaces (Issue #483) (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kezik authored Jan 16, 2024
1 parent 0bb0498 commit 7a3e0c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/app/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ export const getFilesWithInvalidFileSize = (
};

const parseAttachmentUrl = (url: string) => {
const lastIndexSlash = url.lastIndexOf('/');
const decodedUrl = decodeURI(url);
const lastIndexSlash = decodedUrl.lastIndexOf('/');

return {
absolutePath: decodedUrl.slice(0, lastIndexSlash),
name: decodedUrl.slice(lastIndexSlash + 1),
Expand Down Expand Up @@ -145,7 +146,7 @@ export const getDialFilesFromAttachments = (
id: constructPath(relativePath, name),
name,
contentType: attachment.type,
absolutePath: absolutePath,
absolutePath,
};
})
.filter(Boolean) as Omit<DialFile, 'contentLength'>[];
Expand Down

0 comments on commit 7a3e0c5

Please sign in to comment.