- this.dataSource = new CatalogDataSource(this.appMgrService, this.sort, this.notificationService );
- this.dataSource.loadTable();
+ this.dataSource = new CatalogDataSource(this.appMgrService, this.sort, this.notificationService);
+ this.ui.darkModeState.subscribe((isDark) => {
+ this.darkMode = isDark;
+ });
+
+ this.instanceChange = this.instanceSelectorService.getSelectedInstancekey().subscribe((instanceKey: string) => {
+ if (instanceKey) {
+ this.instanceKey = instanceKey;
+ this.dataSource.loadTable(instanceKey);
+ }
+ });
+ }
+
+ ngOnDestroy() {
+ this.instanceChange.unsubscribe();