mirror of https://github.com/logseq/logseq
fix: some persist issues
parent
e46fb4ee62
commit
e86b0eb2a6
|
@ -11,6 +11,10 @@ export class TLHistory<S extends TLShape = TLShape, K extends TLEventMap = TLEve
|
|||
pointer = 0
|
||||
isPaused = true
|
||||
|
||||
get creating() {
|
||||
return this.app.selectedTool.currentState.id === 'creating';
|
||||
}
|
||||
|
||||
pause = () => {
|
||||
if (this.isPaused) return
|
||||
this.isPaused = true
|
||||
|
@ -30,7 +34,7 @@ export class TLHistory<S extends TLShape = TLShape, K extends TLEventMap = TLEve
|
|||
}
|
||||
|
||||
persist = () => {
|
||||
if (this.isPaused) return
|
||||
if (this.isPaused || this.creating) return
|
||||
|
||||
const { serialized } = this.app
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ export class CreatingState<
|
|||
if (!this.app.settings.isToolLocked) {
|
||||
this.app.transition('select')
|
||||
}
|
||||
this.app.persist()
|
||||
}
|
||||
|
||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||
|
|
|
@ -88,6 +88,7 @@ export class CreatingState<
|
|||
})
|
||||
this.tool.previousShape = this.shape
|
||||
this.tool.transition('idle')
|
||||
this.app.persist()
|
||||
}
|
||||
|
||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||
|
|
|
@ -57,6 +57,7 @@ export class CreatingState<
|
|||
if (!this.app.settings.isToolLocked) {
|
||||
this.app.transition('select')
|
||||
}
|
||||
this.app.persist()
|
||||
}
|
||||
|
||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||
|
|
Loading…
Reference in New Issue