From f67cee1fe395919e1e1563bbf793a68a42177af2 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sun, 27 Apr 2025 10:42:08 +0200 Subject: [PATCH] fix bug with not updating contribution message --- .../Contributions/ContributionListItem.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index a08af2e4c..2b0e2b0a1 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -246,7 +246,7 @@ function deleteContribution(item) { } } -const { onResult, onError, load } = useLazyQuery(listContributionMessages, { +const { onResult, onError, load, refetch } = useLazyQuery(listContributionMessages, { contributionId: props.contributionId, }) @@ -254,9 +254,15 @@ function getListContributionMessages(closeCollapse = true) { if (closeCollapse) { emit('close-all-open-collapse') } - load(listContributionMessages, { + const variables = { contributionId: props.contributionId, - }) + } + // load works only once and return false on second call + if (!load(listContributionMessages, variables)) { + // update list data every time getListContributionMessages is called + // because it could be added new messages + refetch(variables) + } } onResult((resultValue) => {