mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: whiteboards block auto resize
This commit is contained in:
@@ -96,7 +96,7 @@ export class HTMLShape extends TLBoxShape<HTMLShapeProps> {
|
||||
React.useEffect(() => {
|
||||
if (this.props.size[1] === 0) {
|
||||
this.onResetBounds({ zoom: app.viewport.camera.zoom })
|
||||
app.persist({replace: true})
|
||||
app.persist()
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
|
||||
size: [this.props.size[0], newHeight],
|
||||
})
|
||||
|
||||
if (loaded) app.persist({replace: true})
|
||||
if (loaded) app.persist({})
|
||||
}
|
||||
}
|
||||
}, [innerHeight, this.props.isAutoResizing])
|
||||
@@ -305,7 +305,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
|
||||
if (!this.initialHeightCalculated) {
|
||||
setTimeout(() => {
|
||||
this.onResetBounds()
|
||||
app.persist({replace: true})
|
||||
app.persist({})
|
||||
})
|
||||
}
|
||||
}, [this.initialHeightCalculated])
|
||||
@@ -423,9 +423,10 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
|
||||
const onPageNameChanged = React.useCallback((id: string, isPage: boolean) => {
|
||||
this.initialHeightCalculated = false
|
||||
const blockType = isPage ? 'P' : 'B'
|
||||
const height = isPage ? 320 : 40
|
||||
this.update({
|
||||
pageId: id,
|
||||
size: [400, 320],
|
||||
size: [400, height],
|
||||
blockType: blockType,
|
||||
compact: blockType === 'B',
|
||||
})
|
||||
|
||||
@@ -61,7 +61,7 @@ export class TweetShape extends TLBoxShape<TweetShapeProps> {
|
||||
this.update({
|
||||
size: [this.props.size[0], newHeight],
|
||||
})
|
||||
app.persist({replace: true})
|
||||
app.persist()
|
||||
}
|
||||
}, [innerHeight])
|
||||
|
||||
@@ -69,7 +69,7 @@ export class TweetShape extends TLBoxShape<TweetShapeProps> {
|
||||
if (!this.initialHeightCalculated) {
|
||||
setTimeout(() => {
|
||||
this.onResetBounds()
|
||||
app.persist({replace: true})
|
||||
app.persist()
|
||||
})
|
||||
}
|
||||
}, [this.initialHeightCalculated])
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user