fix: set access token only once (#2815)

Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
Vinh
2020-01-30 18:37:26 -05:00
committed by GitHub
co-authored by Kim Gardner
parent 190010c898
commit 516611e289
@@ -65,19 +65,23 @@ function handleAccountCompletion(props: Props) {
interface State {
checkedCompletionStatus: boolean;
completed: boolean;
}
class AccountCompletionContainer extends Component<Props, State> {
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() {