Switch active tab if opening component that is already opened
All checks were successful
E2E Testing / test (push) Successful in 1m32s

This commit is contained in:
Sebastian Böckelmann 2024-02-15 20:47:26 +01:00
parent 0fe23b9e39
commit fa7a59ffc4

View File

@ -21,6 +21,8 @@ export class EditorComponent {
if(!this.gameModelComponents.includes(gameModelComponent)) {
this.gameModelComponents.push(gameModelComponent);
this.activeTab = this.gameModelComponents.length;
} else {
this.activeTab = this.gameModelComponents.findIndex(component => component.componentName === gameModelComponent.componentName);
}
}