MCPcopy Create free account
hub / github.com/DTStack/molecule / setActive

Method setActive

src/services/workbench/editorService.ts:588–609  ·  view source on GitHub ↗
(groupId: UniqueId, tabId: UniqueId)

Source from the content-addressed store, hash-verified

586 }
587
588 public setActive(groupId: UniqueId, tabId: UniqueId) {
589 const { groups = [] } = this.state;
590 const groupIndex = this.getGroupIndexById(groupId);
591
592 if (groupIndex > -1) {
593 const nextGroups = [...groups];
594 const group = nextGroups[groupIndex];
595 const tab = this.getTabById(tabId, group.id!);
596
597 if (tab) {
598 const nextGroup = { ...group };
599 nextGroup.tab = { ...tab };
600 nextGroup.activeTab = tabId;
601 nextGroups[groupIndex] = nextGroup;
602
603 this.setState({
604 current: nextGroup,
605 groups: nextGroups,
606 });
607 }
608 }
609 }
610
611 public updateGroup(
612 groupId: UniqueId,

Callers 3

closeOtherMethod · 0.95
closeToRightMethod · 0.95
closeToLeftMethod · 0.95

Calls 3

getGroupIndexByIdMethod · 0.95
getTabByIdMethod · 0.95
setStateMethod · 0.80

Tested by

no test coverage detected