Skip to content

Commit 5d60f45

Browse files
authored
retrieve dirty status and send it via postMessage (#1495)
1 parent 1d2fe6c commit 5d60f45

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ export default defineComponent({
339339
}
340340
)
341341
342-
this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, (resp) => {
343-
this.$store.dispatch('zap/setDirtyState', resp)
342+
this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, () => {
343+
this.$store.dispatch('zap/setDirtyState')
344344
})
345345
},
346346
addClassToBody() {

src/store/zap/actions.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,10 +1281,11 @@ export function updateSelectedUcComponentState(context, projectInfo) {
12811281
/**
12821282
* Set the dirty state for ZAP config when there are unsaved changes.
12831283
* @param {*} context
1284-
* @param {*} isDirty
12851284
*/
1286-
export function setDirtyState(context, isDirty) {
1287-
context.commit('setDirtyState', isDirty)
1285+
export function setDirtyState(context) {
1286+
axiosRequests.$serverGet(restApi.ide.isDirty).then((resp) => {
1287+
context.commit('setDirtyState', resp.data.DIRTY)
1288+
})
12881289
}
12891290

12901291
/**

0 commit comments

Comments
 (0)