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
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m30s
This commit is contained in:
@@ -286,6 +286,9 @@ const onDocClick = (e: MouseEvent) => {
|
|||||||
selectedChoreId.value = null
|
selectedChoreId.value = null
|
||||||
if (path.some((n) => n instanceof HTMLElement && n.classList.contains('item-card'))) {
|
if (path.some((n) => n instanceof HTMLElement && n.classList.contains('item-card'))) {
|
||||||
shouldIgnoreNextCardClick.value = true
|
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) => {
|
const triggerTask = (task: Task) => {
|
||||||
|
if (shouldIgnoreNextCardClick.value) {
|
||||||
|
shouldIgnoreNextCardClick.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
selectedTask.value = task
|
selectedTask.value = task
|
||||||
const pendingRewardIds = getPendingRewardIds()
|
const pendingRewardIds = getPendingRewardIds()
|
||||||
if (pendingRewardIds.length > 0) {
|
if (pendingRewardIds.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user