From 58d85c0f8eb3bd7acf56e9d1a5aafa01237a66f2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 18 Sep 2020 09:42:30 +1000 Subject: [PATCH] fix methods order --- .../session/LeftPaneContactSection.tsx | 20 +++++++++---------- .../session/LeftPaneMessageSection.tsx | 18 ++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ts/components/session/LeftPaneContactSection.tsx b/ts/components/session/LeftPaneContactSection.tsx index b605fac98..eec649874 100644 --- a/ts/components/session/LeftPaneContactSection.tsx +++ b/ts/components/session/LeftPaneContactSection.tsx @@ -64,6 +64,16 @@ export class LeftPaneContactSection extends React.Component { this.closeOverlay = this.closeOverlay.bind(this); } + public componentDidMount() { + MainViewController.renderMessageView(); + + window.Whisper.events.on('calculatingPoW', this.closeOverlay); + } + + public componentDidUpdate() { + MainViewController.renderMessageView(); + } + public componentWillUnmount() { this.updateSearch(''); this.setState({ addContactRecipientID: '' }); @@ -83,16 +93,6 @@ export class LeftPaneContactSection extends React.Component { ); } - public componentDidMount() { - MainViewController.renderMessageView(); - - window.Whisper.events.on('calculatingPoW', this.closeOverlay); - } - - public componentDidUpdate() { - MainViewController.renderMessageView(); - } - public render(): JSX.Element { return (
diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index 7685e92dc..08e93a46a 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -96,6 +96,15 @@ export class LeftPaneMessageSection extends React.Component { this.closeOverlay = this.closeOverlay.bind(this); } + public componentDidMount() { + MainViewController.renderMessageView(); + window.Whisper.events.on('calculatingPoW', this.closeOverlay); + } + + public componentDidUpdate() { + MainViewController.renderMessageView(); + } + public componentWillUnmount() { this.updateSearch(''); window.Whisper.events.off('calculatingPoW', this.closeOverlay); @@ -178,15 +187,6 @@ export class LeftPaneMessageSection extends React.Component { return [list]; } - public componentDidMount() { - MainViewController.renderMessageView(); - window.Whisper.events.on('calculatingPoW', this.closeOverlay); - } - - public componentDidUpdate() { - MainViewController.renderMessageView(); - } - public closeOverlay({ pubKey }: { pubKey: string }) { if (this.state.valuePasted === pubKey) { this.setState({ overlay: false, valuePasted: '' });