mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-07-15 21:43:29 +02:00
Fix flashing screen on the MainActivity when changing the anonymous instance
This commit is contained in:
@ -365,7 +365,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
if (mAccessToken == null) {
|
if (mAccessToken == null) {
|
||||||
String instancePreference = mSharedPreferences.getString(SharedPreferencesUtils.ANONYMOUS_ACCOUNT_INSTANCE, APIUtils.API_BASE_URI);
|
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();
|
this.recreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user