Skip to content

Commit

Permalink
Do not start Jetpack flow when leaving Connect activity
Browse files Browse the repository at this point in the history
  • Loading branch information
planarvoid committed May 15, 2019
1 parent dbf385c commit 982a47a
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ private void startJetpackConnectionFlow(SiteModel siteModel) {
@SuppressWarnings("unused")
@Subscribe(threadMode = ThreadMode.MAIN)
public void onAccountChanged(OnAccountChanged event) {
if (event.isError()) {
AppLog.e(T.API, "StatsConnectJetpackActivity.onAccountChanged error: "
+ event.error.type + " - " + event.error.message);
} else if (!mIsJetpackConnectStarted && event.causeOfChange == AccountAction.FETCH_ACCOUNT
&& !TextUtils.isEmpty(mAccountStore.getAccount().getUserName())) {
startJetpackConnectionFlow((SiteModel) getIntent().getSerializableExtra(SITE));
if (!isFinishing()) {
if (event.isError()) {
AppLog.e(T.API, "StatsConnectJetpackActivity.onAccountChanged error: "
+ event.error.type + " - " + event.error.message);
} else if (!mIsJetpackConnectStarted && event.causeOfChange == AccountAction.FETCH_ACCOUNT
&& !TextUtils.isEmpty(mAccountStore.getAccount().getUserName())) {
startJetpackConnectionFlow((SiteModel) getIntent().getSerializableExtra(SITE));
}
}
}
}

0 comments on commit 982a47a

Please sign in to comment.