From 0309e72c28ac3ebd3372ffc136f04560862d54e7 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Wed, 17 Sep 2025 17:45:06 +0200 Subject: [PATCH] fix plural and remove redundant toast --- apps/studio/state/storage-explorer.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/studio/state/storage-explorer.tsx b/apps/studio/state/storage-explorer.tsx index 51a67b3c364..f198c969703 100644 --- a/apps/studio/state/storage-explorer.tsx +++ b/apps/studio/state/storage-explorer.tsx @@ -1552,10 +1552,9 @@ function createStorageExplorerState({ if (numberOfFilesMovedFail === state.selectedItemsToMove.length) { toast.error('Failed to move files') } else { + const movedFiles = state.selectedItemsToMove.length - numberOfFilesMovedFail toast( - `Successfully moved ${ - state.selectedItemsToMove.length - numberOfFilesMovedFail - } files to ${formattedNewPathToFile.length > 0 ? formattedNewPathToFile : 'the root of your bucket'}` + `Successfully moved ${movedFiles} file${movedFiles > 1 ? 's' : ''} to ${formattedNewPathToFile.length > 0 ? formattedNewPathToFile : 'the root of your bucket'}` ) } @@ -1661,10 +1660,9 @@ function createStorageExplorerState({ if (numberOfFilesMovedFail === items.length) { toast.error('Failed to move items') } else { + const movedFiles = items.length - numberOfFilesMovedFail toast( - `Successfully moved ${ - items.length - numberOfFilesMovedFail - } items to ${formattedNewPathToFile.length > 0 ? formattedNewPathToFile : 'the root of your bucket'}` + `Successfully moved ${movedFiles} item${movedFiles > 1 ? 's' : ''} to ${formattedNewPathToFile.length > 0 ? formattedNewPathToFile : 'the root of your bucket'}` ) } @@ -1782,7 +1780,7 @@ function createStorageExplorerState({ const allItemsToMove = await getAllFilesRecursively(sourceFullPath) const filesToMove = allItemsToMove.filter((item) => !item.isFolder) - // Update progress tracking with total count and show calculation complete + // Update progress tracking with total count const initialProgressData = state.folderMoveProgress.get(sourceFullPath) if (initialProgressData) { state.setFolderMoveProgress(sourceFullPath, { @@ -1790,8 +1788,8 @@ function createStorageExplorerState({ total: filesToMove.length, }) - // Update toast to show calculation complete and move starting - toast.loading( + // Update the existing toast to show calculation complete and move starting + toast(