Skip to content

Commit 476e84f

Browse files
Fix switching account issue in ViewPostDetailActivity and InboxActivity when a user clicks the notification that belongs to another account.
1 parent 9ba4016 commit 476e84f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ mExecutor, new Handler(), mNewAccountName, newAccount -> {
223223
mNewAccountName = null;
224224
if (newAccount != null) {
225225
accessToken = newAccount.getAccessToken();
226+
accountName = newAccount.getAccountName();
226227
}
227228

228229
bindView(savedInstanceState);

app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ mExecutor, new Handler(), mNewAccountName, newAccount -> {
345345
Toast.makeText(this, R.string.account_switched, Toast.LENGTH_SHORT).show();
346346

347347
mNewAccountName = null;
348+
if (newAccount != null) {
349+
accessToken = newAccount.getAccessToken();
350+
accountName = newAccount.getAccountName();
351+
}
348352

349353
bindView(savedInstanceState);
350354
});

0 commit comments

Comments
 (0)