Bug 1938344: Fix choose what to sync not showing on subsequent navigations r=markh,settings-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D233195
This commit is contained in:
@@ -1146,12 +1146,17 @@ var gSync = {
|
||||
},
|
||||
|
||||
_shouldShowSyncOffIndicator() {
|
||||
const newSyncSetupEnabled =
|
||||
NimbusFeatures.syncSetupFlow.getVariable("enabled");
|
||||
if (newSyncSetupEnabled) {
|
||||
NimbusFeatures.syncSetupFlow.recordExposureEvent();
|
||||
// We only ever want to show the user the dot once, once they've clicked into the panel
|
||||
// we do not show them the dot anymore
|
||||
if (
|
||||
Services.prefs.getBoolPref(
|
||||
"identity.fxaccounts.toolbar.syncSetup.panelAccessed",
|
||||
false
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return newSyncSetupEnabled;
|
||||
return NimbusFeatures.syncSetupFlow.getVariable("enabled");
|
||||
},
|
||||
|
||||
updateFxAPanel(state = {}) {
|
||||
|
||||
@@ -120,6 +120,12 @@ var gSyncPane = {
|
||||
// Notify observers that the UI is now ready
|
||||
Services.obs.notifyObservers(window, "sync-pane-loaded");
|
||||
|
||||
this._maybeShowSyncAction();
|
||||
},
|
||||
|
||||
// Check if the user is coming from a call to action
|
||||
// and show them the correct additional panel
|
||||
_maybeShowSyncAction() {
|
||||
if (
|
||||
location.hash == "#sync" &&
|
||||
UIState.get().status == UIState.STATUS_SIGNED_IN
|
||||
@@ -313,6 +319,13 @@ var gSyncPane = {
|
||||
console.error("Failed to enable sync", err);
|
||||
});
|
||||
}
|
||||
// When the modal closes we want to remove any query params
|
||||
// so it doesn't open on subsequent visits (and will reload)
|
||||
const browser = window.docShell.chromeEventHandler;
|
||||
browser.loadURI(Services.io.newURI("about:preferences#sync"), {
|
||||
triggeringPrincipal:
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
},
|
||||
},
|
||||
params /* aParams */
|
||||
|
||||
Reference in New Issue
Block a user