diff --git a/src/App.vue b/src/App.vue index 1d4d386f52..209ffbb720 100644 --- a/src/App.vue +++ b/src/App.vue @@ -326,8 +326,8 @@ export default defineComponent({ } ) - this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, () => { - this.$store.dispatch('zap/setDirtyState') + this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, (resp) => { + this.$store.dispatch('zap/setDirtyState', resp) }) }, addClassToBody() { diff --git a/src/store/zap/actions.js b/src/store/zap/actions.js index 6edfd6cb91..c71664d796 100644 --- a/src/store/zap/actions.js +++ b/src/store/zap/actions.js @@ -1281,11 +1281,10 @@ export function updateSelectedUcComponentState(context, projectInfo) { /** * Set the dirty state for ZAP config when there are unsaved changes. * @param {*} context + * @param {*} isDirty */ -export function setDirtyState(context) { - axiosRequests.$serverGet(restApi.ide.isDirty).then((resp) => { - context.commit('setDirtyState', resp.data.DIRTY) - }) +export function setDirtyState(context, isDirty) { + context.commit('setDirtyState', isDirty) } /**