From 476e84fdca472567dffcf36019e47df518afc108 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sun, 11 Aug 2024 11:39:24 -0400 Subject: Fix switching account issue in ViewPostDetailActivity and InboxActivity when a user clicks the notification that belongs to another account. --- .../docilealligator/infinityforreddit/activities/InboxActivity.java | 1 + .../infinityforreddit/activities/ViewPostDetailActivity.java | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java index 30879333..fa6c28b5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/InboxActivity.java @@ -223,6 +223,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf mNewAccountName = null; if (newAccount != null) { accessToken = newAccount.getAccessToken(); + accountName = newAccount.getAccountName(); } bindView(savedInstanceState); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index 40aaafe7..73df4d13 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -345,6 +345,10 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele Toast.makeText(this, R.string.account_switched, Toast.LENGTH_SHORT).show(); mNewAccountName = null; + if (newAccount != null) { + accessToken = newAccount.getAccessToken(); + accountName = newAccount.getAccountName(); + } bindView(savedInstanceState); }); -- cgit v1.2.3