Skip to content

Commit

Permalink
fix: set false on successive completion actions with compulsory deope…
Browse files Browse the repository at this point in the history
…rands
  • Loading branch information
tomzemp committed Dec 10, 2024
1 parent fb52233 commit 81505eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bottom-bar/use-on-complete-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default function useOnCompleteCallback() {

if (hasCompulsoryDataElementOperandsToFillOut) {
setCompleteAttempted(true)
cancelCompletionMutation()
cancelCompletionMutation({ completedBoolean: false })
promise = Promise.reject(
new Error(
i18n.t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function useImperativeCancelCompletionMutation() {
const mutationKey = useSetFormCompletionMutationKey()
const dataValueSetQueryKey = useDataValueSetQueryKey()

return () => {
return ({ completedBoolean } = {}) => {
const foundMutation = mutationCache.find({ mutationKey })

if (!foundMutation) {
Expand All @@ -30,7 +30,7 @@ export default function useImperativeCancelCompletionMutation() {
...previousDataValueSet,
completeStatus: {
...previousDataValueSet.completeStatus,
complete: !completed,
complete: completedBoolean ?? !completed,
},
})
)
Expand Down

0 comments on commit 81505eb

Please sign in to comment.