Fix flashing screen on the MainActivity when changing the anonymous instance

This commit is contained in:
Balazs Toldi 2023-08-25 22:23:20 +02:00
parent 5cdda037b2
commit d5fff14cb0
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -365,7 +365,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
super.onResume();
if (mAccessToken == null) {
String instancePreference = mSharedPreferences.getString(SharedPreferencesUtils.ANONYMOUS_ACCOUNT_INSTANCE, APIUtils.API_BASE_URI);
if (!mRetrofit.getBaseURL().equalsIgnoreCase(instancePreference)) {
if (!instancePreference.startsWith(mRetrofit.getBaseURL())) {
mRetrofit.setBaseURL(instancePreference);
this.recreate();
}
}