Skip to content

Commit b4e20ff

Browse files
committed
fix: update selection logic to use filtered files instead of all files
1 parent a74a236 commit b4e20ff

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • apps/dashboard/app/pages/(dashboard)/dashboard/files

apps/dashboard/app/pages/(dashboard)/dashboard/files/index.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
leave-active-class="motion-safe:(animate-out fade-out zoom-out-95)"
6767
>
6868
<div
69-
v-if="selectionMode && selectedFiles.length && files.length"
69+
v-if="selectionMode && selectedFiles.length && filtered.length"
7070
flex="~ items-center gap-2"
7171
>
7272
<UiButton
@@ -103,9 +103,9 @@
103103
leave-active-class="motion-safe:(animate-out fade-out zoom-out-95)"
104104
>
105105
<UiButton
106-
v-if="selectionMode && files.length"
106+
v-if="selectionMode && filtered.length"
107107
:icon="
108-
selectedFiles.length === files.length
108+
selectedFiles.length === filtered.length
109109
? 'solar:list-cross-minimalistic-bold'
110110
: 'solar:list-check-minimalistic-bold'
111111
"
@@ -116,20 +116,22 @@
116116
rounded-xl="!"
117117
:disabled="bulkDeleting"
118118
@click="
119-
selectedFiles.length === files.length
119+
selectedFiles.length === filtered.length
120120
? (selectedFiles = [])
121-
: (selectedFiles = files.map((f) => f.id))
121+
: (selectedFiles = filtered.map((f) => f.id))
122122
"
123123
>
124-
{{ selectedFiles.length === files.length ? 'Deselect All' : 'Select All' }}
124+
{{
125+
selectedFiles.length === filtered.length ? 'Deselect All' : 'Select All'
126+
}}
125127
</UiButton>
126128
</Transition>
127129
<Transition
128130
enter-active-class="motion-safe:(animate-in fade-in zoom-in-95)"
129131
leave-active-class="motion-safe:(animate-out fade-out zoom-out-95)"
130132
>
131133
<UiButton
132-
v-if="files.length"
134+
v-if="filtered.length"
133135
:icon="
134136
selectionMode ? 'solar:close-square-bold' : 'solar:check-square-bold'
135137
"
@@ -186,7 +188,7 @@
186188
<div v-for="file in calculatedFiles" :key="file.id" op0 class="fileCard">
187189
<FileCard
188190
:data="file"
189-
:selectable="selectionMode && files.length > 0"
191+
:selectable="selectionMode && filtered.length > 0"
190192
:selected="selectionMode && selectedFiles.includes(file.id)"
191193
@view-file="
192194
(file) => {

0 commit comments

Comments
 (0)