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

Commit 596dbde

Browse files
keianhzobluemarvin
authored andcommitted
Avoid opening the success tab if the account is existing/restored (#2232)
1 parent 566f446 commit 596dbde

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

app/src/common/shared/org/mozilla/vrbrowser/browser/Accounts.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import mozilla.components.service.fxa.sync.SyncStatusObserver
2323
import mozilla.components.service.fxa.sync.getLastSynced
2424
import mozilla.components.support.base.log.logger.Logger
2525
import org.mozilla.vrbrowser.VRBrowserApplication
26-
import org.mozilla.vrbrowser.browser.engine.SessionStore
2726
import org.mozilla.vrbrowser.utils.SystemUtils
2827
import java.util.concurrent.CompletableFuture
2928
import java.util.concurrent.ExecutionException

app/src/common/shared/org/mozilla/vrbrowser/browser/Services.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import org.mozilla.geckoview.AllowOrDeny
2828
import org.mozilla.geckoview.GeckoResult
2929
import org.mozilla.geckoview.GeckoSession
3030
import org.mozilla.vrbrowser.R
31-
import org.mozilla.vrbrowser.browser.engine.SessionStore
3231

3332
class Services(context: Context, places: Places): GeckoSession.NavigationDelegate {
3433
companion object {

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import java.io.Writer;
3535
import java.lang.reflect.Type;
3636
import java.util.ArrayList;
37-
import java.util.Arrays;
3837
import java.util.Collections;
3938
import java.util.List;
4039
import java.util.stream.Collectors;
@@ -891,22 +890,24 @@ public void onLoggedOut() {
891890

892891
@Override
893892
public void onAuthenticated(@NotNull OAuthAccount oAuthAccount, @NotNull AuthType authType) {
894-
Session session = mFocusedWindow.getSession();
895-
addTab(mFocusedWindow, mAccounts.getConnectionSuccessURL());
896-
onTabsClose(new ArrayList<>(Collections.singletonList(session)));
897-
898-
switch (mAccounts.getLoginOrigin()) {
899-
case BOOKMARKS:
900-
getFocusedWindow().switchBookmarks();
901-
break;
902-
903-
case HISTORY:
904-
getFocusedWindow().switchHistory();
905-
break;
906-
907-
case SETTINGS:
908-
mWidgetManager.getTray().toggleSettingsDialog(SettingsWidget.SettingDialog.FXA);
909-
break;
893+
if (authType != AuthType.Existing.INSTANCE) {
894+
Session session = mFocusedWindow.getSession();
895+
addTab(mFocusedWindow, mAccounts.getConnectionSuccessURL());
896+
onTabsClose(new ArrayList<>(Collections.singletonList(session)));
897+
898+
switch (mAccounts.getLoginOrigin()) {
899+
case BOOKMARKS:
900+
getFocusedWindow().switchBookmarks();
901+
break;
902+
903+
case HISTORY:
904+
getFocusedWindow().switchHistory();
905+
break;
906+
907+
case SETTINGS:
908+
mWidgetManager.getTray().toggleSettingsDialog(SettingsWidget.SettingDialog.FXA);
909+
break;
910+
}
910911
}
911912
}
912913

0 commit comments

Comments
 (0)