Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Oct 9, 2024
1 parent 75c00f7 commit cd44636
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/js/composables/selections/selections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,34 @@ export function useSelection(
}

function selectEverything() {
// @ts-expect-error
if (selectedPhotosIdx.value.length === photos.value.length) {
// Flip and select albums
selectedPhotosIdx.value = [];
// @ts-expect-error
selectedAlbumsIdx.value = Array.from(Array(albums.value.length).keys());
return;
}
// @ts-expect-error
if (selectedAlbumsIdx.value.length === albums.value.length) {
selectedAlbumsIdx.value = [];
// @ts-expect-error
selectedPhotosIdx.value = Array.from(Array(photos.value.length).keys());
// Flip and select photos
return;
}
if (selectedAlbumsIdx.value.length > 0) {
// @ts-expect-error
selectedAlbumsIdx.value = Array.from(Array(albums.value.length).keys());
return;
}
// @ts-expect-error
if (photos.value.length > 0) {
// @ts-expect-error
selectedPhotosIdx.value = Array.from(Array(photos.value.length).keys());
return;
}
// @ts-expect-error
selectedAlbumsIdx.value = Array.from(Array(albums.value.length).keys());
}

Expand Down

0 comments on commit cd44636

Please sign in to comment.