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:
Sammy Khamis
2025-01-13 22:37:03 +00:00
parent 2546fd16d8
commit ac45be94e6
2 changed files with 23 additions and 5 deletions

View File

@@ -1146,12 +1146,17 @@ var gSync = {
}, },
_shouldShowSyncOffIndicator() { _shouldShowSyncOffIndicator() {
const newSyncSetupEnabled = // We only ever want to show the user the dot once, once they've clicked into the panel
NimbusFeatures.syncSetupFlow.getVariable("enabled"); // we do not show them the dot anymore
if (newSyncSetupEnabled) { if (
NimbusFeatures.syncSetupFlow.recordExposureEvent(); Services.prefs.getBoolPref(
"identity.fxaccounts.toolbar.syncSetup.panelAccessed",
false
)
) {
return false;
} }
return newSyncSetupEnabled; return NimbusFeatures.syncSetupFlow.getVariable("enabled");
}, },
updateFxAPanel(state = {}) { updateFxAPanel(state = {}) {

View File

@@ -120,6 +120,12 @@ var gSyncPane = {
// Notify observers that the UI is now ready // Notify observers that the UI is now ready
Services.obs.notifyObservers(window, "sync-pane-loaded"); 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 ( if (
location.hash == "#sync" && location.hash == "#sync" &&
UIState.get().status == UIState.STATUS_SIGNED_IN UIState.get().status == UIState.STATUS_SIGNED_IN
@@ -313,6 +319,13 @@ var gSyncPane = {
console.error("Failed to enable sync", err); 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 */ params /* aParams */