fix: failed to find group

This commit is contained in:
chuyuan.du 2024-08-01 13:36:16 +08:00
parent 73e5dc3571
commit 38323d9429

View File

@ -800,7 +800,7 @@ export class DockviewComponent
group = item;
const popoutReferenceGroupId = this._popoutGroups.find(
(_) => _.popoutGroup === group
(_) => _.popoutGroup.id === group.id
)?.referenceGroup;
const popoutReferenceGroup = popoutReferenceGroupId
? this.getPanel(popoutReferenceGroupId)
@ -1715,7 +1715,7 @@ export class DockviewComponent
if (group.api.location.type === 'floating') {
const floatingGroup = this._floatingGroups.find(
(_) => _.group === group
(_) => _.group.id === group.id
);
if (floatingGroup) {
@ -1728,7 +1728,7 @@ export class DockviewComponent
remove(this._floatingGroups, floatingGroup);
floatingGroup.dispose();
if (!options?.skipActive && this._activeGroup === group) {
if (!options?.skipActive && this._activeGroup?.id === group.id) {
const groups = Array.from(this._groups.values());
this.doSetGroupAndPanelActive(
@ -1744,7 +1744,7 @@ export class DockviewComponent
if (group.api.location.type === 'popout') {
const selectedGroup = this._popoutGroups.find(
(_) => _.popoutGroup === group
(_) => _.popoutGroup.id === group.id
);
if (selectedGroup) {
@ -1771,7 +1771,7 @@ export class DockviewComponent
this.doSetGroupAndPanelActive(removedGroup);
}
if (!options?.skipActive && this._activeGroup === group) {
if (!options?.skipActive && this._activeGroup?.id === group.id) {
const groups = Array.from(this._groups.values());
this.doSetGroupAndPanelActive(