From a508cfdf9814a0f2d0b3c30f454e331e63d4fb10 Mon Sep 17 00:00:00 2001 From: Luke Thomas <96008479+Zoobdude@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:07:25 +0000 Subject: [PATCH 1/2] fix(client): hide no file or content error when file is uploaded --- .../src/modules/notes/pages/create-note.page.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-client/src/modules/notes/pages/create-note.page.tsx b/packages/app-client/src/modules/notes/pages/create-note.page.tsx index a28a0389..ca76bb54 100644 --- a/packages/app-client/src/modules/notes/pages/create-note.page.tsx +++ b/packages/app-client/src/modules/notes/pages/create-note.page.tsx @@ -118,6 +118,11 @@ export const CreateNotePage: Component = () => { setError(null); } + function updateUploadedFiles(files: File[]) { + setUploadedFiles(prevFiles => [...prevFiles, ...files]) + setError(null) + } + const getIsShareApiSupported = () => navigator.share !== undefined; const shareNote = async () => { @@ -209,7 +214,7 @@ export const CreateNotePage: Component = () => {
- setUploadedFiles(prevFiles => [...prevFiles, ...files])}> + updateUploadedFiles(files)}>
{t('create.settings.attach-files')}
From 3c5f03193f41400dd4e200711266a209f6a50262 Mon Sep 17 00:00:00 2001 From: Luke Thomas <96008479+Zoobdude@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:15:21 +0000 Subject: [PATCH 2/2] lint --- .../app-client/src/modules/notes/pages/create-note.page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-client/src/modules/notes/pages/create-note.page.tsx b/packages/app-client/src/modules/notes/pages/create-note.page.tsx index ca76bb54..53ef2a68 100644 --- a/packages/app-client/src/modules/notes/pages/create-note.page.tsx +++ b/packages/app-client/src/modules/notes/pages/create-note.page.tsx @@ -119,8 +119,8 @@ export const CreateNotePage: Component = () => { } function updateUploadedFiles(files: File[]) { - setUploadedFiles(prevFiles => [...prevFiles, ...files]) - setError(null) + setUploadedFiles(prevFiles => [...prevFiles, ...files]); + setError(null); } const getIsShareApiSupported = () => navigator.share !== undefined;