fix(editor): repeat instantiation of std (#10896)

This commit is contained in:
L-Sun
2025-03-17 01:04:51 +00:00
parent 7e6ff8d9c6
commit c1301be1f5
2 changed files with 8 additions and 2 deletions

View File

@@ -77,7 +77,10 @@ export class EdgelessEditor extends SignalWatcher(
changedProperties: Map<string | number | symbol, unknown>
) {
super.willUpdate(changedProperties);
if (changedProperties.has('doc')) {
if (
this.hasUpdated && // skip the first update
changedProperties.has('doc')
) {
this.std = new BlockStdScope({
store: this.doc,
extensions: this.specs,

View File

@@ -89,7 +89,10 @@ export class PageEditor extends SignalWatcher(
changedProperties: Map<string | number | symbol, unknown>
) {
super.willUpdate(changedProperties);
if (changedProperties.has('doc')) {
if (
this.hasUpdated && // skip the first update
changedProperties.has('doc')
) {
this.std = new BlockStdScope({
store: this.doc,
extensions: this.specs,