fix(editor): Redirect to workflow editor after saving in debug mode (#7645)

This commit is contained in:
Csaba Tuncsik
2023-11-08 14:04:02 +01:00
committed by GitHub
parent 5df583f783
commit 020042ef1a
3 changed files with 41 additions and 11 deletions

View File

@@ -379,7 +379,17 @@ export default defineComponent({
name: this.workflowName,
tags: this.currentWorkflowTagIds,
});
if (saved) await this.settingsStore.fetchPromptsData();
if (saved) {
await this.settingsStore.fetchPromptsData();
if (this.$route.name === VIEWS.EXECUTION_DEBUG) {
await this.$router.replace({
name: VIEWS.WORKFLOW,
params: { name: this.currentWorkflowId },
});
}
}
},
onShareButtonClick() {
this.uiStore.openModalWithData({

View File

@@ -459,7 +459,11 @@ export default defineComponent({
},
},
async beforeRouteLeave(to, from, next) {
if (getNodeViewTab(to) === MAIN_HEADER_TABS.EXECUTIONS || from.name === VIEWS.TEMPLATE_IMPORT) {
if (
getNodeViewTab(to) === MAIN_HEADER_TABS.EXECUTIONS ||
from.name === VIEWS.TEMPLATE_IMPORT ||
(getNodeViewTab(to) === MAIN_HEADER_TABS.WORKFLOW && from.name === VIEWS.EXECUTION_DEBUG)
) {
next();
return;
}
@@ -793,7 +797,16 @@ export default defineComponent({
},
async onSaveKeyboardShortcut(e: KeyboardEvent) {
let saved = await this.saveCurrentWorkflow();
if (saved) await this.settingsStore.fetchPromptsData();
if (saved) {
await this.settingsStore.fetchPromptsData();
if (this.$route.name === VIEWS.EXECUTION_DEBUG) {
await this.$router.replace({
name: VIEWS.WORKFLOW,
params: { name: this.currentWorkflow },
});
}
}
if (this.activeNode) {
// If NDV is open, save will not work from editable input fields
// so don't show success message if this is true
@@ -3995,7 +4008,7 @@ export default defineComponent({
const node = tempWorkflow.nodes[nodeNameTable[nodeName]];
try {
this.setPinData(node, data.pinData![nodeName], 'add-nodes');
this.setPinData(node, data.pinData[nodeName], 'add-nodes');
pinDataSuccess = true;
} catch (error) {
pinDataSuccess = false;