mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-23 09:17:06 +08:00
fix(core): fix active view undefined (#6131)
close https://github.com/toeverything/AFFiNE/issues/6127, #6132
This commit is contained in:
@@ -98,8 +98,9 @@ export class Workbench {
|
|||||||
if (index === -1) return;
|
if (index === -1) return;
|
||||||
const newViews = [...this.views.value];
|
const newViews = [...this.views.value];
|
||||||
newViews.splice(index, 1);
|
newViews.splice(index, 1);
|
||||||
if (index !== 0) {
|
const activeViewIndex = this.activeViewIndex.value;
|
||||||
this.active(index - 1);
|
if (activeViewIndex !== 0 && activeViewIndex >= index) {
|
||||||
|
this.active(activeViewIndex - 1);
|
||||||
}
|
}
|
||||||
this.views.next(newViews);
|
this.views.next(newViews);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user