Skip to content

Commit c6d83ea

Browse files
authored
[UK-975] Check condition before updating current user info (#36)
1 parent 6e66ed1 commit c6d83ea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/dux/sdk/thunks.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ export const handleConnection = ({
6666
userDispatcher({ type: INIT_USER, payload: user });
6767
// use nickname/profileUrl if provided
6868
// or set userID as nickname
69-
const newNickName = nickname || user.nickname;
70-
const newProfileUrl = profileUrl || user.profileUrl;
71-
newSdk.updateCurrentUserInfo(newNickName, newProfileUrl)
72-
.then((namedUser) => {
73-
userDispatcher({ type: UPDATE_USER_INFO, payload: namedUser });
74-
});
69+
if (nickname !== user.nickname || profileUrl !== user.profileUrl) {
70+
newSdk.updateCurrentUserInfo(nickname || user.nickname, profileUrl || user.profileUrl)
71+
.then((namedUser) => {
72+
userDispatcher({ type: UPDATE_USER_INFO, payload: namedUser });
73+
});
74+
}
7575
};
7676

7777
const connectCbError = (e) => {

0 commit comments

Comments
 (0)