Skip to content

Commit 24a1155

Browse files
committed
fix: fix saving login action twice on signin
1 parent ee8f847 commit 24a1155

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/signin/SignInScreen.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,11 @@ class SignInScreen extends Component {
107107
user: Map(),
108108
};
109109

110-
componentDidMount = () => {
111-
this.handleOnAuthenticated();
112-
};
113-
114-
componentDidUpdate = () => {
115-
this.handleOnAuthenticated();
110+
componentDidUpdate = ({ authenticated: prevAuthenticated }) => {
111+
const { authenticated } = this.props;
112+
if (prevAuthenticated !== authenticated) {
113+
this.handleOnAuthenticated();
114+
}
116115
};
117116

118117
handleOnAuthenticated = () => {

0 commit comments

Comments
 (0)