Refactor chore selection logic to pass 'chores' parameter to getSelectedChoresData in bulk actions

This commit is contained in:
Mo Tarbin
2026-03-23 22:30:56 -04:00
parent 3c29d4a19f
commit cd2fa7943b
2 changed files with 7 additions and 6 deletions

View File

@@ -529,10 +529,11 @@ const MyChores = () => {
onEnableMultiSelectAndSelectAll: () => {
toggleMultiSelectMode()
setTimeout(() => {
selectAllVisibleChores()
selectAllVisibleChores(null, choreSections, openChoreSections)
}, 0)
},
onSelectAll: () => selectAllVisibleChores(),
onSelectAll: () =>
selectAllVisibleChores(null, choreSections, openChoreSections),
onClearSelection: clearSelection,
onBulkComplete: handleBulkComplete,
onBulkSkip: handleBulkSkip,

View File

@@ -472,7 +472,7 @@ export const useChoreActions = ({
)
const handleBulkComplete = useCallback(async () => {
const selectedData = getSelectedChoresData()
const selectedData = getSelectedChoresData(chores)
if (selectedData.length === 0) return
setConfirmModelConfig({
@@ -532,7 +532,7 @@ export const useChoreActions = ({
}, [getSelectedChoresData, impersonatedUser, showSuccess, showError, refetchChores, clearSelection, setConfirmModelConfig])
const handleBulkArchive = useCallback(async () => {
const selectedData = getSelectedChoresData()
const selectedData = getSelectedChoresData(chores)
if (selectedData.length === 0) return
setConfirmModelConfig({
@@ -594,7 +594,7 @@ export const useChoreActions = ({
}, [getSelectedChoresData, archiveChore, setChores, setFilteredChores, showSuccess, showError, refetchChores, clearSelection, setConfirmModelConfig])
const handleBulkDelete = useCallback(async () => {
const selectedData = getSelectedChoresData()
const selectedData = getSelectedChoresData(chores)
if (selectedData.length === 0) return
setConfirmModelConfig({
@@ -654,7 +654,7 @@ export const useChoreActions = ({
}, [getSelectedChoresData, chores, filteredChores, setChores, setFilteredChores, showSuccess, showError, refetchChores, clearSelection, setConfirmModelConfig])
const handleBulkSkip = useCallback(async () => {
const selectedData = getSelectedChoresData()
const selectedData = getSelectedChoresData(chores)
if (selectedData.length === 0) return
setConfirmModelConfig({