fix: deactivate themes on deinit
This commit is contained in:
@@ -55,11 +55,15 @@ class ComponentViewCtrl implements ComponentViewScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$onDestroy() {
|
$onDestroy() {
|
||||||
this.application.componentManager.onComponentIframeDestroyed(this.component.uuid);
|
if(this.application.componentManager) {
|
||||||
|
/** Component manager Can be destroyed already via locking */
|
||||||
|
this.application.componentManager.onComponentIframeDestroyed(this.component.uuid);
|
||||||
|
if(this.templateComponent) {
|
||||||
|
this.application.componentManager.removeTemporaryTemplateComponent(this.templateComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(this.liveComponent) {
|
if(this.liveComponent) {
|
||||||
this.liveComponent.deinit();
|
this.liveComponent.deinit();
|
||||||
} else {
|
|
||||||
this.application.componentManager.removeTemporaryTemplateComponent(this.templateComponent);
|
|
||||||
}
|
}
|
||||||
this.cleanUpOn();
|
this.cleanUpOn();
|
||||||
(this.cleanUpOn as any) = undefined;
|
(this.cleanUpOn as any) = undefined;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export class ThemeManager extends ApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
|
this.clearAppThemeState();
|
||||||
this.unsubState?.();
|
this.unsubState?.();
|
||||||
(this.unsubState as any) = undefined;
|
(this.unsubState as any) = undefined;
|
||||||
this.activeThemes.length = 0;
|
this.activeThemes.length = 0;
|
||||||
@@ -89,10 +90,14 @@ export class ThemeManager extends ApplicationService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private deactivateAllThemes() {
|
private clearAppThemeState() {
|
||||||
for (const uuid of this.activeThemes) {
|
for (const uuid of this.activeThemes) {
|
||||||
this.deactivateTheme(uuid, false);
|
this.deactivateTheme(uuid, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private deactivateAllThemes() {
|
||||||
|
this.clearAppThemeState();
|
||||||
this.activeThemes = [];
|
this.activeThemes = [];
|
||||||
this.decacheThemes();
|
this.decacheThemes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export declare class ThemeManager extends ApplicationService {
|
|||||||
onAppStart(): Promise<void>;
|
onAppStart(): Promise<void>;
|
||||||
private activateCachedThemes;
|
private activateCachedThemes;
|
||||||
private registerObservers;
|
private registerObservers;
|
||||||
|
private clearAppThemeState;
|
||||||
private deactivateAllThemes;
|
private deactivateAllThemes;
|
||||||
private activateTheme;
|
private activateTheme;
|
||||||
private deactivateTheme;
|
private deactivateTheme;
|
||||||
|
|||||||
Reference in New Issue
Block a user