Skip to content

Commit

Permalink
Merge pull request #9868 from wordpress-mobile/fix/do_not_start_jetpa…
Browse files Browse the repository at this point in the history
…ck_flow_when_leaving_connection_activity

Do not start Jetpack flow when leaving Connect activity
  • Loading branch information
khaykov authored May 15, 2019
2 parents 0d05f36 + 982a47a commit 0e1a701
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 0e1a701

Please sign in to comment.