Skip to content

Commit

Permalink
fix edit dirty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
miyosuda committed Aug 1, 2023
1 parent 82f4a82 commit 32da97b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ ipc.on('response', (event : Event,
arg : string,
obj : any) => {
if( arg == 'set-dirty' ) {
editDirty = obj
editDirty = true
} else if( arg == 'set-root-text' ) {
rootText = obj;
rootText = obj
} else if( arg == 'response-save' ) {
const json = JSON.stringify(obj, null , ' ')

Expand Down Expand Up @@ -359,6 +359,7 @@ const templateMenu : Electron.MenuItemConstructorOptions[] = [
// filePathの設定
filePath = null;
rootText = null;
editDirty = false;
browserWindow.setTitle(DEFAULT_TITLE);
}

Expand Down
8 changes: 3 additions & 5 deletions src/map-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export class MapManager {
this.lastMouseDownTime = -1

this.ghostNode.hide()

this.setDirty(false)
}

prepare() {
Expand Down Expand Up @@ -812,7 +810,7 @@ export class MapManager {
const state = this.getState()
this.editHistory.addHistory(state)

this.setDirty(true)
this.setDirty()
}

applyNodeState(state : StateType,
Expand Down Expand Up @@ -996,8 +994,8 @@ export class MapManager {
this.cursorDepth = 0
}

setDirty(dirty : boolean) {
nmAPI.sendMessage('set-dirty', dirty)
setDirty() {
nmAPI.sendMessage('set-dirty', null)
}

debugDump() {
Expand Down

0 comments on commit 32da97b

Please sign in to comment.