Skip to content

Commit

Permalink
fix: fix saving login action twice on signin
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Sep 25, 2020
1 parent ee8f847 commit 24a1155
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/signin/SignInScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ class SignInScreen extends Component {
user: Map(),
};

componentDidMount = () => {
this.handleOnAuthenticated();
};

componentDidUpdate = () => {
this.handleOnAuthenticated();
componentDidUpdate = ({ authenticated: prevAuthenticated }) => {
const { authenticated } = this.props;
if (prevAuthenticated !== authenticated) {
this.handleOnAuthenticated();
}
};

handleOnAuthenticated = () => {
Expand Down

0 comments on commit 24a1155

Please sign in to comment.