Component and other handler deregisterations
This commit is contained in:
@@ -31,6 +31,8 @@ class FooterCtrl extends PureCtrl {
|
||||
deinit() {
|
||||
this.rooms.length = 0;
|
||||
this.themesWithIcons.length = 0;
|
||||
this.unregisterComponent();
|
||||
this.unregisterComponent = null;
|
||||
this.rootScopeListener1();
|
||||
this.rootScopeListener2();
|
||||
this.rootScopeListener1 = null;
|
||||
@@ -65,11 +67,7 @@ class FooterCtrl extends PureCtrl {
|
||||
|
||||
onAppLaunch() {
|
||||
super.onAppLaunch();
|
||||
const hasPasscode = this.application.hasPasscode();
|
||||
this.setState({
|
||||
hasPasscode: hasPasscode
|
||||
});
|
||||
|
||||
this.reloadPasscodeStatus();
|
||||
this.reloadUpgradeStatus();
|
||||
this.user = this.application.getUser();
|
||||
this.updateOfflineStatus();
|
||||
@@ -78,6 +76,13 @@ class FooterCtrl extends PureCtrl {
|
||||
this.registerComponentHandler();
|
||||
}
|
||||
|
||||
async reloadPasscodeStatus() {
|
||||
const hasPasscode = this.application.hasPasscode();
|
||||
this.setState({
|
||||
hasPasscode: hasPasscode
|
||||
});
|
||||
}
|
||||
|
||||
addRootScopeListeners() {
|
||||
this.rootScopeListener1 = this.$rootScope.$on("reload-ext-data", () => {
|
||||
this.reloadExtendedData();
|
||||
@@ -118,6 +123,13 @@ class FooterCtrl extends PureCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async onAppKeyChange() {
|
||||
super.onAppKeyChange();
|
||||
this.reloadPasscodeStatus();
|
||||
}
|
||||
|
||||
|
||||
/** @override */
|
||||
onAppEvent(eventName) {
|
||||
if (eventName === ApplicationEvents.KeyStatusChanged) {
|
||||
@@ -183,7 +195,7 @@ class FooterCtrl extends PureCtrl {
|
||||
}
|
||||
|
||||
registerComponentHandler() {
|
||||
this.application.componentManager.registerHandler({
|
||||
this.unregisterComponent = this.application.componentManager.registerHandler({
|
||||
identifier: "roomBar",
|
||||
areas: ["rooms", "modal"],
|
||||
activationHandler: (component) => { },
|
||||
|
||||
Reference in New Issue
Block a user