Skip to content

Commit

Permalink
fix: persisting collapsed state of portals
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and logseq-cldwalker committed Mar 13, 2023
1 parent 874b4d9 commit 7a889a0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx
Expand Up @@ -146,27 +146,19 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
this.update({ compact: collapsed })
this.canResize[1] = !collapsed
if (!collapsed) {
// this will also persist the state, so we can skip persist call
await delay()
this.onResetBounds()
}
this.persist?.()
} else {
const originalHeight = this.props.size[1]
this.canResize[1] = !collapsed
console.log(
collapsed,
collapsed ? this.getHeaderHeight() : this.props.collapsedHeight,
this.getHeaderHeight(),
this.props.collapsedHeight
)
this.update({
isAutoResizing: !collapsed,
collapsed: collapsed,
size: [this.props.size[0], collapsed ? this.getHeaderHeight() : this.props.collapsedHeight],
collapsedHeight: collapsed ? originalHeight : this.props.collapsedHeight,
})
}
this.persist?.()
}

@computed get scaleLevel() {
Expand Down

0 comments on commit 7a889a0

Please sign in to comment.