fix(ui): dnd image count

This commit is contained in:
psychedelicious 2024-08-27 16:16:11 +10:00
parent eedf81dcc5
commit fe3b2ed357
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import { createSelector } from '@reduxjs/toolkit';
import { galleryImageClicked } from 'app/store/middleware/listenerMiddleware/listeners/galleryImageClicked';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { selectHasSelection } from 'features/gallery/store/gallerySelectors';
import { selectHasMultipleImagesSelected } from 'features/gallery/store/gallerySelectors';
import { selectGallerySlice, selectionChanged } from 'features/gallery/store/gallerySlice';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
import type { MouseEvent } from 'react';
@ -10,7 +10,7 @@ import type { ImageDTO } from 'services/api/types';
export const useMultiselect = (imageDTO?: ImageDTO) => {
const dispatch = useAppDispatch();
const areMultiplesSelected = useAppSelector(selectHasSelection);
const areMultiplesSelected = useAppSelector(selectHasMultipleImagesSelected);
const selectIsSelected = useMemo(
() =>
createSelector(selectGallerySlice, (gallery) =>

View File

@ -45,7 +45,7 @@ export const selectAutoAssignBoardOnClick = createSelector(
export const selectBoardSearchText = createSelector(selectGallerySlice, (gallery) => gallery.boardSearchText);
export const selectSearchTerm = createSelector(selectGallerySlice, (gallery) => gallery.searchTerm);
export const selectSelectionCount = createSelector(selectGallerySlice, (gallery) => gallery.selection.length);
export const selectHasSelection = createSelector(selectSelectionCount, (count) => count > 0);
export const selectHasMultipleImagesSelected = createSelector(selectSelectionCount, (count) => count > 1);
export const selectGalleryImageMinimumWidth = createSelector(
selectGallerySlice,
(gallery) => gallery.galleryImageMinimumWidth