Skip to content

Commit

Permalink
Move refresh call to prevent assignments from being fetched twice
Browse files Browse the repository at this point in the history
  • Loading branch information
renanferrari committed Feb 18, 2021
1 parent 145fe0d commit d69506f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WordPress/src/main/java/org/wordpress/android/WordPress.java
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ public StoryNotificationTrackerProvider getStoryNotificationTrackerProvider() {
void onAppComesFromBackground() {
mApplicationLifecycleMonitor.onAppComesFromBackground();
mAppConfig.refresh();
mExPlat.refreshIfNeeded();
}

@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
Expand Down Expand Up @@ -1000,6 +999,12 @@ public void onAppComesFromBackground() {
// Let's migrate the old editor preference if available in AppPrefs to the remote backend
SiteUtils.migrateAppWideMobileEditorPreferenceToRemote(mAccountStore, mSiteStore, mDispatcher);

if (!mFirstActivityResumed) {
// Since we're force refreshing on app startup, we don't need to try refreshing again
// when starting our first Activity.
mExPlat.refreshIfNeeded();
}

if (mFirstActivityResumed) {
deferredInit();
}
Expand Down

0 comments on commit d69506f

Please sign in to comment.