mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00: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;
|
||||
const newViews = [...this.views.value];
|
||||
newViews.splice(index, 1);
|
||||
if (index !== 0) {
|
||||
this.active(index - 1);
|
||||
const activeViewIndex = this.activeViewIndex.value;
|
||||
if (activeViewIndex !== 0 && activeViewIndex >= index) {
|
||||
this.active(activeViewIndex - 1);
|
||||
}
|
||||
this.views.next(newViews);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user