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
|
pointer = 0
|
||||||
isPaused = true
|
isPaused = true
|
||||||
|
|
||||||
|
get creating() {
|
||||||
|
return this.app.selectedTool.currentState.id === 'creating';
|
||||||
|
}
|
||||||
|
|
||||||
pause = () => {
|
pause = () => {
|
||||||
if (this.isPaused) return
|
if (this.isPaused) return
|
||||||
this.isPaused = true
|
this.isPaused = true
|
||||||
|
@ -30,7 +34,7 @@ export class TLHistory<S extends TLShape = TLShape, K extends TLEventMap = TLEve
|
||||||
}
|
}
|
||||||
|
|
||||||
persist = () => {
|
persist = () => {
|
||||||
if (this.isPaused) return
|
if (this.isPaused || this.creating) return
|
||||||
|
|
||||||
const { serialized } = this.app
|
const { serialized } = this.app
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ export class CreatingState<
|
||||||
if (!this.app.settings.isToolLocked) {
|
if (!this.app.settings.isToolLocked) {
|
||||||
this.app.transition('select')
|
this.app.transition('select')
|
||||||
}
|
}
|
||||||
|
this.app.persist()
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||||
|
|
|
@ -88,6 +88,7 @@ export class CreatingState<
|
||||||
})
|
})
|
||||||
this.tool.previousShape = this.shape
|
this.tool.previousShape = this.shape
|
||||||
this.tool.transition('idle')
|
this.tool.transition('idle')
|
||||||
|
this.app.persist()
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||||
|
|
|
@ -57,6 +57,7 @@ export class CreatingState<
|
||||||
if (!this.app.settings.isToolLocked) {
|
if (!this.app.settings.isToolLocked) {
|
||||||
this.app.transition('select')
|
this.app.transition('select')
|
||||||
}
|
}
|
||||||
|
this.app.persist()
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
onWheel: TLStateEvents<S, K>['onWheel'] = (info, e) => {
|
||||||
|
|
Loading…
Reference in New Issue