fix: reset ready state on outside click and prevent task trigger on ignored clicks
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m30s

This commit is contained in:
2026-02-26 16:44:22 -05:00
parent a197f8e206
commit f5a752d873

View File

@@ -286,6 +286,9 @@ const onDocClick = (e: MouseEvent) => {
selectedChoreId.value = null
if (path.some((n) => n instanceof HTMLElement && n.classList.contains('item-card'))) {
shouldIgnoreNextCardClick.value = true
} else {
// Clicked fully outside any card — reset ready state so chore requires 2 clicks again
readyItemId.value = null
}
}
}
@@ -550,6 +553,10 @@ function getPendingRewardIds(): string[] {
}
const triggerTask = (task: Task) => {
if (shouldIgnoreNextCardClick.value) {
shouldIgnoreNextCardClick.value = false
return
}
selectedTask.value = task
const pendingRewardIds = getPendingRewardIds()
if (pendingRewardIds.length > 0) {