fix(editor): view recorded in storage may not exist (#9788)

fix: BS-2415
This commit is contained in:
zzj3720
2025-01-20 05:36:42 +00:00
parent 1a18aeb22e
commit 66b6fd8b74
5 changed files with 25 additions and 13 deletions
@@ -333,7 +333,12 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<DatabaseBloc
this._dataSource = new DatabaseBlockDataSource(this.model);
this._dataSource.contextSet(HostContextKey, this.host);
const id = currentViewStorage.getCurrentView(this.model.id);
if (id) {
if (id && this.dataSource.viewManager.viewGet(id)) {
console.log(
'set current view',
id,
this._dataSource.viewManager.viewGet(id)
);
this.dataSource.viewManager.setCurrentView(id);
}
}