From 6d78d9ed643296b6dfa6ab3ffd0ae5295a46243a Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 17 Sep 2024 17:56:53 +0200 Subject: [PATCH 1/5] fix(create): uploading file adds to the existing file list, dedupe file list Closes #184 --- src/pages/create/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index dd17450..7f39b11 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -301,7 +301,15 @@ export const CreatePage = () => { const handleSelectFiles = (event: React.ChangeEvent) => { if (event.target.files) { - setSelectedFiles(Array.from(event.target.files)) + // Get the uploaded files + const files = Array.from(event.target.files) + + // Remove duplicates based on the file.name + setSelectedFiles((p) => + [...p, ...files].filter( + (file, i, array) => i === array.findIndex((t) => t.name === file.name) + ) + ) } } From ebd59471c79335555ddf43748b3dd3457b65eb42 Mon Sep 17 00:00:00 2001 From: enes Date: Thu, 19 Sep 2024 09:53:16 +0200 Subject: [PATCH 2/5] fix: footer portal on relays --- src/pages/settings/relays/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/relays/index.tsx b/src/pages/settings/relays/index.tsx index 4ed5d62..a1f5223 100644 --- a/src/pages/settings/relays/index.tsx +++ b/src/pages/settings/relays/index.tsx @@ -233,6 +233,7 @@ export const RelaysPage = () => { ))} )} +