From 34104495c57d0ad59615098e68e25f7181529bb0 Mon Sep 17 00:00:00 2001 From: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:05:13 -0400 Subject: [PATCH] fix: adding files count in toast (#960) * fix: adding files count in toast * fix: toast to use plural function --- src/files-and-videos/generic/FileInput.jsx | 2 +- src/files-and-videos/generic/messages.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files-and-videos/generic/FileInput.jsx b/src/files-and-videos/generic/FileInput.jsx index 455853722f..c953994d22 100644 --- a/src/files-and-videos/generic/FileInput.jsx +++ b/src/files-and-videos/generic/FileInput.jsx @@ -11,7 +11,7 @@ export const useFileInput = ({ const click = () => ref.current.click(); const addFile = (e) => { const { files } = e.target; - setSelectedRows(files); + setSelectedRows([...files]); onAddFile(Object.values(files)); setAddOpen(); e.target.value = ''; diff --git a/src/files-and-videos/generic/messages.js b/src/files-and-videos/generic/messages.js index d6f6d03e87..1906f1ba78 100644 --- a/src/files-and-videos/generic/messages.js +++ b/src/files-and-videos/generic/messages.js @@ -8,7 +8,7 @@ const messages = defineMessages({ }, apiStatusToastMessage: { id: 'course-authoring.files-and-upload.apiStatus.message', - defaultMessage: '{actionType} {selectedRowCount} {fileType}(s)', + defaultMessage: '{actionType} {selectedRowCount} {selectedRowCount, plural, one {{fileType}} other {{fileType}s}}', description: 'This message is showed in the toast when action is applied to files', }, apiStatusAddingAction: {