fix: history on create portal

This commit is contained in:
Konstantinos Kaloutas
2023-03-09 11:52:05 +02:00
committed by Gabriel Horner
parent cff17ab891
commit 6657286c4f

View File

@@ -276,6 +276,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
return null // not being correctly configured
}
const { Page, Block } = renderers
const [loaded, setLoaded] = React.useState(false)
React.useEffect(() => {
if (this.props.isAutoResizing) {
@@ -285,13 +286,12 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
this.update({
size: [this.props.size[0], newHeight],
})
app.persist(true)
if (loaded) app.persist(true)
}
}
}, [innerHeight, this.props.isAutoResizing])
const [loaded, setLoaded] = React.useState(false)
React.useEffect(() => {
if (!this.initialHeightCalculated) {
setTimeout(() => {