From 6460f6303cb63644a262e16384e06888a4dd3e06 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 24 Apr 2020 17:36:02 +0100 Subject: [PATCH] Move store subscribe to didmount --- src/components/views/dialogs/SetupEncryptionDialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/SetupEncryptionDialog.js b/src/components/views/dialogs/SetupEncryptionDialog.js index 71b7574551..d7723de588 100644 --- a/src/components/views/dialogs/SetupEncryptionDialog.js +++ b/src/components/views/dialogs/SetupEncryptionDialog.js @@ -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); }