Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,9 @@ public void updateEmail(final String newEmail, final IterableHelper.SuccessHandl
sendPostRequest(IterableConstants.ENDPOINT_UPDATE_EMAIL, requestJSON, new IterableHelper.SuccessHandler() {
@Override
public void onSuccess(JSONObject data) {
_email = newEmail;
if (_email != null) {
_email = newEmail;
}
storeEmailAndUserId();
if (successHandler != null) {
successHandler.onSuccess(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ public void testUpdateEmailWithUserId() throws Exception {
JSONObject requestJson = new JSONObject(updateEmailRequest.getBody().readUtf8());
assertEquals("testUserId", requestJson.getString(IterableConstants.KEY_CURRENT_USERID));
assertEquals("new@email.com", requestJson.getString(IterableConstants.KEY_NEW_EMAIL));
assertNull(IterableApi.getInstance().getEmail());
assertEquals("testUserId", IterableApi.getInstance().getUserId());
}

@Test
Expand Down