Merge remote-tracking branch 'origin/fix/application-group-improvments' into 004
This commit is contained in:
@@ -15,7 +15,7 @@ import { AppState } from '@/ui_models/app_state';
|
|||||||
type AppManagerChangeCallback = () => void
|
type AppManagerChangeCallback = () => void
|
||||||
|
|
||||||
export class ApplicationGroup {
|
export class ApplicationGroup {
|
||||||
|
|
||||||
$compile: ng.ICompileService
|
$compile: ng.ICompileService
|
||||||
$rootScope: ng.IRootScopeService
|
$rootScope: ng.IRootScopeService
|
||||||
$timeout: ng.ITimeoutService
|
$timeout: ng.ITimeoutService
|
||||||
@@ -50,8 +50,9 @@ export class ApplicationGroup {
|
|||||||
}
|
}
|
||||||
if (this.applications.length === 0) {
|
if (this.applications.length === 0) {
|
||||||
this.createDefaultApplication();
|
this.createDefaultApplication();
|
||||||
|
} else {
|
||||||
|
this.notifyObserversOfAppChange();
|
||||||
}
|
}
|
||||||
this.notifyObserversOfAppChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private createNewApplication() {
|
private createNewApplication() {
|
||||||
@@ -121,6 +122,11 @@ export class ApplicationGroup {
|
|||||||
if (this.application) {
|
if (this.application) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
const indexOfObserver = this.changeObservers.indexOf(callback);
|
||||||
|
this.changeObservers.splice(indexOfObserver, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private notifyObserversOfAppChange() {
|
private notifyObserversOfAppChange() {
|
||||||
|
|||||||
Reference in New Issue
Block a user