Skip to content

Commit

Permalink
admin: Remove selectableIds from Main List
Browse files Browse the repository at this point in the history
... as it's useless most of the time
  • Loading branch information
ThrRip committed Dec 18, 2024
1 parent 9a215d0 commit fc7f070
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/admin/app/components/playlist/MainList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<input
type="checkbox"
class="hidden"
@click="selectedIds = selectedIds.size === selectableIds.length ? new Set() : new Set(selectableIds)"
@click="selectedIds = selectedIds.size === props.data.length ?
new Set() :
new Set(props.data.map(song => song.$id))"
>
<span class="grid place-items-center w-5">
<svg class="hidden"><symbol id="far-square"><font-awesome-icon :icon="['far', 'square']" /></symbol></svg>
Expand All @@ -30,12 +32,12 @@
<use href="#far-square" />
</svg>
<font-awesome-icon
v-if="selectedIds.size !== 0 && selectedIds.size !== selectableIds.length"
v-if="selectedIds.size !== 0 && selectedIds.size !== props.data.length"
:icon="['fas', 'square-minus']"
class="!h-5 text-blue group-hover:text-blue-a transition group-active:scale-90"
/>
<svg
v-if="selectedIds.size !== 0 && selectedIds.size === selectableIds.length"
v-if="selectedIds.size !== 0 && selectedIds.size === props.data.length"
class="size-5 text-blue group-hover:text-blue-a transition group-active:scale-90"
>
<use href="#fas-square-check" />
Expand Down Expand Up @@ -375,7 +377,6 @@ function scrollList (position: 'top' | 'bottom') {
}
}

const selectableIds = computed<Array<Song['$id']>>(() => props.data.map(song => song.$id))
const selectedIds = ref<Set<Song['$id']>>(new Set())

interface ModifyTarget {
Expand Down

0 comments on commit fc7f070

Please sign in to comment.