From 516611e2894e4bb9b836c427d0247d09e9de6b0c Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 31 Jan 2020 00:37:26 +0100 Subject: [PATCH] fix: set access token only once (#2815) Co-authored-by: Kim Gardner --- .../AccountCompletion/AccountCompletionContainer.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/client/auth/App/AccountCompletion/AccountCompletionContainer.tsx b/src/core/client/auth/App/AccountCompletion/AccountCompletionContainer.tsx index ceba7cefc..e8c26e554 100644 --- a/src/core/client/auth/App/AccountCompletion/AccountCompletionContainer.tsx +++ b/src/core/client/auth/App/AccountCompletion/AccountCompletionContainer.tsx @@ -65,19 +65,23 @@ function handleAccountCompletion(props: Props) { interface State { checkedCompletionStatus: boolean; + completed: boolean; } class AccountCompletionContainer extends Component { public state = { checkedCompletionStatus: false, + completed: false, }; public componentDidMount() { - handleAccountCompletion(this.props); - this.setState({ checkedCompletionStatus: true }); + const completed = handleAccountCompletion(this.props); + this.setState({ checkedCompletionStatus: true, completed }); } public componentDidUpdate() { - handleAccountCompletion(this.props); + if (!this.state.completed) { + handleAccountCompletion(this.props); + } } public render() {