From b69245aedc543fc7f8da1c0e41cf1ba3f16f92e9 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Thu, 4 Jan 2024 19:12:18 +0100 Subject: [PATCH] Fix shortcut login issues Fix issues with home screen shortcuts not logging the user in properly --- .../activities/ViewSubredditDetailActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java index 1337f399..acc5962c 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java @@ -392,6 +392,14 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null); mAccountQualifiedName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_QUALIFIED_NAME, null); + if (mAccessToken != null) { + mRetrofit.setAccessToken(mAccessToken); + } + String instance = (mAccessToken == null) ? mSharedPreferences.getString(SharedPreferencesUtils.ANONYMOUS_ACCOUNT_INSTANCE, APIUtils.API_BASE_URI) : mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_INSTANCE, null); + if (instance != null) { + mRetrofit.setBaseURL(instance); + } + if (savedInstanceState == null) { mMessageFullname = getIntent().getIntExtra(EXTRA_MESSAGE_FULLNAME, 0); mNewAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME);