mirror of https://github.com/logseq/logseq
fix: persisting collapsed state of portals
parent
874b4d9f9a
commit
7a889a042b
|
@ -146,20 +146,11 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
|
||||||
this.update({ compact: collapsed })
|
this.update({ compact: collapsed })
|
||||||
this.canResize[1] = !collapsed
|
this.canResize[1] = !collapsed
|
||||||
if (!collapsed) {
|
if (!collapsed) {
|
||||||
// this will also persist the state, so we can skip persist call
|
|
||||||
await delay()
|
|
||||||
this.onResetBounds()
|
this.onResetBounds()
|
||||||
}
|
}
|
||||||
this.persist?.()
|
|
||||||
} else {
|
} else {
|
||||||
const originalHeight = this.props.size[1]
|
const originalHeight = this.props.size[1]
|
||||||
this.canResize[1] = !collapsed
|
this.canResize[1] = !collapsed
|
||||||
console.log(
|
|
||||||
collapsed,
|
|
||||||
collapsed ? this.getHeaderHeight() : this.props.collapsedHeight,
|
|
||||||
this.getHeaderHeight(),
|
|
||||||
this.props.collapsedHeight
|
|
||||||
)
|
|
||||||
this.update({
|
this.update({
|
||||||
isAutoResizing: !collapsed,
|
isAutoResizing: !collapsed,
|
||||||
collapsed: collapsed,
|
collapsed: collapsed,
|
||||||
|
@ -167,6 +158,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
|
||||||
collapsedHeight: collapsed ? originalHeight : this.props.collapsedHeight,
|
collapsedHeight: collapsed ? originalHeight : this.props.collapsedHeight,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.persist?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get scaleLevel() {
|
@computed get scaleLevel() {
|
||||||
|
|
Loading…
Reference in New Issue