Skip to content

Commit

Permalink
fix: validate interstitial on redirect next task
Browse files Browse the repository at this point in the history
  • Loading branch information
devmiguelangel committed Jul 22, 2024
1 parent 7c8638c commit c2a5f74
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export default {
*/
// eslint-disable-next-line consistent-return
async getDestinationUrl() {
const { elementDestination } = this.task || {};
const { elementDestination, allow_interstitial: allowInterstitial } = this.task || {};
if (!elementDestination) {
return null;
Expand All @@ -437,7 +437,7 @@ export default {
const response = await this.retryApiCall(() => this.getTasks(params));
const firstTask = response.data.data[0];
if (firstTask?.user_id === this.userId) {
if (allowInterstitial && firstTask?.user_id === this.userId) {
return `/tasks/${firstTask.id}/edit`;
}
Expand Down Expand Up @@ -487,6 +487,8 @@ export default {
this.nodeId = task.element_id;
} else if (this.parentRequest && ['COMPLETED', 'CLOSED'].includes(this.task.process_request.status)) {
this.$emit('completed', this.getAllowedRequestId());
} else if (!this.taskPreview) {
this.emitClosedEvent();
}
});
},
Expand Down Expand Up @@ -602,8 +604,8 @@ export default {
const queryParams = {
user_id: this.userId,
process_request_id: params.processRequestId,
page: params.page,
per_page: params.perPage,
page: params.page || 1,
per_page: params.perPage || 1,
status: params.status,
};
Expand Down

0 comments on commit c2a5f74

Please sign in to comment.