Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Avoid opening the success tab if the account is existing/restored (#2232
Browse files Browse the repository at this point in the history
)
  • Loading branch information
keianhzo authored and bluemarvin committed Nov 12, 2019
1 parent 566f446 commit 596dbde
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import mozilla.components.service.fxa.sync.SyncStatusObserver
import mozilla.components.service.fxa.sync.getLastSynced
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.vrbrowser.VRBrowserApplication
import org.mozilla.vrbrowser.browser.engine.SessionStore
import org.mozilla.vrbrowser.utils.SystemUtils
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.mozilla.geckoview.AllowOrDeny
import org.mozilla.geckoview.GeckoResult
import org.mozilla.geckoview.GeckoSession
import org.mozilla.vrbrowser.R
import org.mozilla.vrbrowser.browser.engine.SessionStore

class Services(context: Context, places: Places): GeckoSession.NavigationDelegate {
companion object {
Expand Down
35 changes: 18 additions & 17 deletions app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.io.Writer;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -891,22 +890,24 @@ public void onLoggedOut() {

@Override
public void onAuthenticated(@NotNull OAuthAccount oAuthAccount, @NotNull AuthType authType) {
Session session = mFocusedWindow.getSession();
addTab(mFocusedWindow, mAccounts.getConnectionSuccessURL());
onTabsClose(new ArrayList<>(Collections.singletonList(session)));

switch (mAccounts.getLoginOrigin()) {
case BOOKMARKS:
getFocusedWindow().switchBookmarks();
break;

case HISTORY:
getFocusedWindow().switchHistory();
break;

case SETTINGS:
mWidgetManager.getTray().toggleSettingsDialog(SettingsWidget.SettingDialog.FXA);
break;
if (authType != AuthType.Existing.INSTANCE) {
Session session = mFocusedWindow.getSession();
addTab(mFocusedWindow, mAccounts.getConnectionSuccessURL());
onTabsClose(new ArrayList<>(Collections.singletonList(session)));

switch (mAccounts.getLoginOrigin()) {
case BOOKMARKS:
getFocusedWindow().switchBookmarks();
break;

case HISTORY:
getFocusedWindow().switchHistory();
break;

case SETTINGS:
mWidgetManager.getTray().toggleSettingsDialog(SettingsWidget.SettingDialog.FXA);
break;
}
}
}

Expand Down

0 comments on commit 596dbde

Please sign in to comment.