From 7e672ec1171ace57753d9684120de31453cf8eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 19 Mar 2024 08:33:33 +0100 Subject: [PATCH] Reset Selected Gamesystem after Deletion --- src/app/app.component.ts | 4 +++- .../gamescript-overview/gamescript-overview.component.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8c8ef98..cdc62e8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -146,10 +146,12 @@ export class AppComponent implements OnInit{ } else { parentGamesystemName = this.gamesystemOverview!.selectedGamesystemName; } + + const createdGamesystem = this.gameModel!.createGamesystem("New Gamesystem", parentGamesystemName); if(createdGamesystem != undefined) { this.gamesystemOverview!.refresh(); - this.editor?.openGameModelComponent(createdGamesystem!); + this.editor?.openGameModelComponent(createdGamesystem); } } diff --git a/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts b/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts index 38c0c5c..a3341ac 100644 --- a/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts +++ b/src/app/side-overviews/gamescript-overview/gamescript-overview.component.ts @@ -102,6 +102,7 @@ export class GamescriptOverviewComponent implements OnInit { refresh() { this.dataSource.data = this.gameModel!.gamesystems; + this.resetSelectedGamesystem() } resetSelectedGamesystem() {