From 7a889a042b869343a9cdc7789956a96df9188aa2 Mon Sep 17 00:00:00 2001 From: Konstantinos Kaloutas Date: Wed, 8 Mar 2023 16:33:40 +0200 Subject: [PATCH] fix: persisting collapsed state of portals --- .../tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx b/tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx index 9d6eeaaad13..32fc801e32c 100644 --- a/tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx +++ b/tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx @@ -146,20 +146,11 @@ export class LogseqPortalShape extends TLBoxShape { 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, @@ -167,6 +158,7 @@ export class LogseqPortalShape extends TLBoxShape { collapsedHeight: collapsed ? originalHeight : this.props.collapsedHeight, }) } + this.persist?.() } @computed get scaleLevel() {