diff --git a/src/components/task.vue b/src/components/task.vue index 80536e494..87402c9fd 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -164,9 +164,16 @@ export default { task: { handler() { + if (!this.screen) { + // if no current screen show the interstitial screen if exists + this.screen = this.task && this.task.interstitial_screen; + } this.taskId = this.task.id; this.nodeId = this.task.element_id; this.listenForParentChanges(); + if (this.task.process_request.status === 'COMPLETED') { + this.$emit('completed', this.task.process_request.id); + } }, }, @@ -525,6 +532,15 @@ export default { this.nodeId = this.initialNodeId; this.requestData = this.value; this.loopContext = this.initialLoopContext; + if ( + this.$parent.task && + !this.$parent.task.screen && + this.$parent.task.allow_interstitial && + this.$parent.task.interstitial_screen + ) { + // if interstitial screen exists, show it + this.screen = this.$parent.task.interstitial_screen; + } }, destroyed() { this.unsubscribeSocketListeners();