From 8a3df8d0e1d2518066af7daf8b4b8145dce21667 Mon Sep 17 00:00:00 2001 From: Alex Ackermann Date: Sat, 12 Jul 2025 21:58:55 +0200 Subject: [PATCH] fix: show more details in trash overview filter when filtering is active --- .../src/views/trash/Overview.vue | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/web-app-files/src/views/trash/Overview.vue b/packages/web-app-files/src/views/trash/Overview.vue index 1b32dc75ee..a606067e7f 100644 --- a/packages/web-app-files/src/views/trash/Overview.vue +++ b/packages/web-app-files/src/views/trash/Overview.vue @@ -164,16 +164,30 @@ const loadResourcesTask = useTask(function* (signal) { const areResourcesLoading = computed(() => loadResourcesTask.isRunning || !loadResourcesTask.last) -const footerTextTotal = computed(() => - $ngettext( - '%{spaceCount} trash bin in total', - '%{spaceCount} trash bins in total', +const footerTextTotal = computed(() => { + const emptyTrashSpaces = unref(spaces).filter((s) => s.hasTrashedItems === false) + + if (!emptyTrashSpaces.length) { + return $ngettext( + '%{spaceCount} trash bin in total', + '%{spaceCount} trash bins in total', + unref(spaces).length, + { + spaceCount: unref(spaces).length.toString() + } + ) + } + + return $ngettext( + '%{spaceCount} trash bin in total (including %{emptyTrashCount} empty)', + '%{spaceCount} trash bins in total (including %{emptyTrashCount} empty)', unref(spaces).length, { - spaceCount: unref(spaces).length.toString() + spaceCount: unref(spaces).length.toString(), + emptyTrashCount: emptyTrashSpaces.length.toString() } ) -) +}) const footerTextFilter = computed(() => $ngettext(