@processmaker/screen-builder 3.8.21 → 3.8.22-patch-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "3.8.21",
3
+ "version": "3.8.22-patch-a",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -692,7 +692,7 @@ export default {
692
692
  return null;
693
693
  }
694
694
  },
695
-
695
+
696
696
  /**
697
697
  * Handles redirection upon process completion, considering destination type and user task validation.
698
698
  * @async
@@ -831,7 +831,26 @@ export default {
831
831
  * @param {Object} data - The event data received from the socket listener.
832
832
  */
833
833
  handleProcessUpdate(data) {
834
- if (data.event === 'ACTIVITY_EXCEPTION') {
834
+ if (!this.task) {
835
+ // reload the task if it is not found
836
+ this.reload();
837
+ return;
838
+ }
839
+
840
+ const { event, elementDestination, tokenId } = data;
841
+
842
+ // If the activity is completed and there is an element destination, set the element destination to the task
843
+ if (
844
+ event === "ACTIVITY_COMPLETED" &&
845
+ this.task.id === tokenId &&
846
+ elementDestination
847
+ ) {
848
+ this.task.elementDestination = elementDestination;
849
+ // update allow_interstitial based on the element destination change after the submit
850
+ this.task.allow_interstitial = elementDestination.type === "displayNextAssignedTask";
851
+ }
852
+
853
+ if (event === 'ACTIVITY_EXCEPTION') {
835
854
  this.$emit('error', this.requestId);
836
855
  window.location.href = `/requests/${this.requestId}`;
837
856
  }