Skip to content

Commit

Permalink
Merge branch 'next' into feature/FOUR-14409
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanpro committed Mar 28, 2024
2 parents 7436577 + 8d3a93f commit 05765c5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,7 @@ export default {
return allowed ? this.parentRequest : this.requestId
},
processUpdated: _.debounce(function(data) {
if (
data.event === 'ACTIVITY_COMPLETED' ||
data.event === 'ACTIVITY_ACTIVATED'
) {
if (data.event === 'ACTIVITY_ACTIVATED') {
this.reload();
}
if (data.event === 'ACTIVITY_EXCEPTION') {
Expand Down Expand Up @@ -528,6 +525,13 @@ export default {
this.reload();
}
},
existsEventMessage(id, data) {
if (sessionStorage.getItem(id)) {
return true;
}
sessionStorage.setItem(id, data);
return false;
},
listenForParentChanges() {
if (!this.parentRequest) {
return;
Expand All @@ -537,10 +541,16 @@ export default {
`ProcessMaker.Models.ProcessRequest.${this.parentRequest}`,
'.ProcessUpdated',
(data) => {
if (['ACTIVITY_ACTIVATED'].includes(data.event)) {
if (
['ACTIVITY_ACTIVATED'].includes(data.event) &&
!this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
) {
this.closeTask(this.parentRequest);
}
if (['ACTIVITY_COMPLETED'].includes(data.event)) {
if (
["ACTIVITY_COMPLETED"].includes(data.event) &&
!this.existsEventMessage(`${data.event}-${this.userId}-${this.taskId}`)
) {
if (this.task.process_request.status === 'COMPLETED') {
this.processCompleted();
}
Expand Down

0 comments on commit 05765c5

Please sign in to comment.