mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 07:36:42 +08:00
fix(core): split view solo view crash (#9432)
This commit is contained in:
@@ -43,8 +43,10 @@ export class Workbench extends Entity {
|
||||
activeView$ = LiveData.computed(get => {
|
||||
const activeIndex = get(this.activeViewIndex$);
|
||||
const views = get(this.views$);
|
||||
return views[activeIndex]; // todo: this could be null
|
||||
// activeIndex could be out of bounds when reordering views
|
||||
return views.at(activeIndex) || views[0];
|
||||
});
|
||||
|
||||
location$ = LiveData.computed(get => {
|
||||
return get(get(this.activeView$).location$);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user