Skip to content

Commit

Permalink
retrieve dirty status and send it via postMessage (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulr34 authored Dec 12, 2024
1 parent 1d2fe6c commit 5d60f45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ export default defineComponent({
}
)

this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, (resp) => {
this.$store.dispatch('zap/setDirtyState', resp)
this.$onWebSocket(dbEnum.wsCategory.dirtyFlag, () => {
this.$store.dispatch('zap/setDirtyState')
})
},
addClassToBody() {
Expand Down
7 changes: 4 additions & 3 deletions src/store/zap/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,11 @@ 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, isDirty) {
context.commit('setDirtyState', isDirty)
export function setDirtyState(context) {
axiosRequests.$serverGet(restApi.ide.isDirty).then((resp) => {
context.commit('setDirtyState', resp.data.DIRTY)
})
}

/**
Expand Down

0 comments on commit 5d60f45

Please sign in to comment.