Skip to content

Commit

Permalink
Fix a user settings bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Danic <mario@lovelyhq.com>
  • Loading branch information
mario committed Jun 5, 2018
1 parent 58bdc2c commit 6f59a88
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,22 +331,16 @@ protected void onAttach(@NonNull View view) {
}


boolean needsToUpdateUserId = !TextUtils.isEmpty(userProfileOverall.getOcs().getData().getUserId()) &&
!userProfileOverall.getOcs().getData().getUserId().equals(userEntity.getUserId());
if ((!TextUtils.isEmpty(displayName) && !displayName.equals(userEntity.getDisplayName())) ||
needsToUpdateUserId) {
if ((!TextUtils.isEmpty(displayName) && !displayName.equals(userEntity.getDisplayName()))) {

dbQueryDisposable = userUtils.createOrUpdateUser(null,
null,
null, displayName, null, null,
userProfileOverall.getOcs().getData().getUserId(), userEntity.getId(), null, null)
null, userEntity.getId(), null, null)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(userEntityResult -> {
displayNameTextView.setText(userEntityResult.getDisplayName());
if (needsToUpdateUserId) {
loadAvatarImage();
}
},
throwable -> {
dispose(dbQueryDisposable);
Expand Down

0 comments on commit 6f59a88

Please sign in to comment.