mirror of
https://github.com/wassname/talk.git
synced 2026-07-26 13:37:38 +08:00
fix: set access token only once (#2815)
Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user