mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
fix(editor): view recorded in storage may not exist (#9788)
fix: BS-2415
This commit is contained in:
@@ -473,7 +473,7 @@ export class DatabaseBlockDataSource extends DataSourceBase {
|
||||
return duplicateView(this._model, id);
|
||||
}
|
||||
|
||||
viewDataGet(viewId: string): DataViewDataType {
|
||||
viewDataGet(viewId: string): DataViewDataType | undefined {
|
||||
return this.viewDataList$.value.find(data => data.id === viewId)!;
|
||||
}
|
||||
|
||||
@@ -499,8 +499,11 @@ export class DatabaseBlockDataSource extends DataSourceBase {
|
||||
return view;
|
||||
}
|
||||
|
||||
viewMetaGetById(viewId: string): ViewMeta {
|
||||
viewMetaGetById(viewId: string): ViewMeta | undefined {
|
||||
const view = this.viewDataGet(viewId);
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
return this.viewMetaGet(view.mode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user