Move store subscribe to didmount

pull/21833/head
David Baker 2020-04-24 17:36:02 +01:00
parent bbce37b92f
commit 6460f6303c
1 changed files with 4 additions and 1 deletions

View File

@ -38,10 +38,13 @@ export default class SetupEncryptionDialog extends React.Component {
super();
this.store = SetupEncryptionStore.sharedInstance();
this.store.on("update", this._onStoreUpdate);
this.state = {icon: iconFromPhase(this.store.phase)};
}
componentDidMount() {
this.store.on("update", this._onStoreUpdate);
}
componentWillUnmount() {
this.store.removeListener("update", this._onStoreUpdate);
}