mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Stop unsaved changes popup display when navigating away from an untouched workflow (#5259)
* fix(editor): Stop unsaved changes popup showing up after loading a workflow * fix(editor): Fix unsaved change confirmation display
This commit is contained in:
@@ -315,7 +315,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
},
|
||||
|
||||
setWorkflowName(data: { newName: string; setStateDirty: boolean }): void {
|
||||
if (data.setStateDirty === true) {
|
||||
if (data.setStateDirty) {
|
||||
const uiStore = useUIStore();
|
||||
uiStore.stateIsDirty = true;
|
||||
}
|
||||
@@ -532,16 +532,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
dataPinningEventBus.$emit('unpin-data', { [payload.node.name]: undefined });
|
||||
},
|
||||
|
||||
addConnection(data: { connection: IConnection[]; setStateDirty: boolean }): void {
|
||||
addConnection(data: { connection: IConnection[] }): void {
|
||||
if (data.connection.length !== 2) {
|
||||
// All connections need two entries
|
||||
// TODO: Check if there is an error or whatever that is supposed to be returned
|
||||
return;
|
||||
}
|
||||
const uiStore = useUIStore();
|
||||
if (data.setStateDirty === true) {
|
||||
uiStore.stateIsDirty = true;
|
||||
}
|
||||
|
||||
const sourceData: IConnection = data.connection[0];
|
||||
const destinationData: IConnection = data.connection[1];
|
||||
@@ -626,7 +622,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
},
|
||||
|
||||
removeAllConnections(data: { setStateDirty: boolean }): void {
|
||||
if (data && data.setStateDirty === true) {
|
||||
if (data && data.setStateDirty) {
|
||||
const uiStore = useUIStore();
|
||||
uiStore.stateIsDirty = true;
|
||||
}
|
||||
@@ -771,7 +767,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
},
|
||||
|
||||
removeAllNodes(data: { setStateDirty: boolean; removePinData: boolean }): void {
|
||||
if (data.setStateDirty === true) {
|
||||
if (data.setStateDirty) {
|
||||
const uiStore = useUIStore();
|
||||
uiStore.stateIsDirty = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user