Skip to content

Commit ddf5895

Browse files
committed
Refine task redirection logic for ConversationalForm to prevent async inconsistencies
1 parent 3d31075 commit ddf5895

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/task.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,18 @@ export default {
878878
this.loadingTask = true;
879879
// Check if interstitial tasks are allowed for this task.
880880
if (this.task && !(this.task.allow_interstitial || this.isSameUser(this.task, data))) {
881-
// The getDestinationUrl() function is called asynchronously to retrieve the URL
881+
// The getDestinationUrl() function is called asynchronously to retrieve the URL
882882
window.location.href = await this.getDestinationUrl();
883883
return;
884884
}
885885
this.nodeId = data.params[0].nodeId;
886886
this.taskId = data.params[0].tokenId;
887887
888-
// Force a redirect to ensure the correct task is loaded immediately.
889-
// This prevents async reloads that may cause inconsistencies.
890-
window.location.href = `/tasks/${this.taskId}/edit`;
888+
// Force a redirect to ensure the correct task is loaded immediately for ConversationalForm.
889+
// This prevents async reloads that may cause inconsistencies specific to ConversationalForm.
890+
if (this.renderComponent === "ConversationalForm") {
891+
window.location.href = `/tasks/${this.taskId}/edit`;
892+
}
891893
}
892894
},
893895

0 commit comments

Comments
 (0)