diff --git a/browser/base/content/browser-syncui.js b/browser/base/content/browser-syncui.js index 44be05b7fc5..132a4a718a8 100644 --- a/browser/base/content/browser-syncui.js +++ b/browser/base/content/browser-syncui.js @@ -211,6 +211,24 @@ let gSyncUI = { this.clearError(title); }, + // Set visibility of "Setup Sync" link + showSetupSyncAboutHome: function SUI_showSetupSyncAboutHome(toShow) { + let browsers = gBrowser.browsers; + for (let i = 0; i < browsers.length; i++) { + let b = browsers[i]; + if ("about:home" == b.currentURI.spec) { + b.contentDocument.getElementById("setupSyncLink").hidden = !toShow; + } + } + }, + + onSetupComplete: function SUI_onSetupComplete() { + // Remove "setup sync" link in about:home if it is open. + this.showSetupSyncAboutHome(false); + + onLoginFinish(); + }, + onLoginError: function SUI_onLoginError() { // if login fails, any other notifications are essentially moot Weave.Notifications.removeAll(); @@ -255,6 +273,8 @@ let gSyncUI = { onStartOver: function SUI_onStartOver() { this.clearError(); + // Make "setup sync" link visible in about:home if it is open. + this.showSetupSyncAboutHome(true); }, onQuotaNotice: function onQuotaNotice(subject, data) { @@ -486,7 +506,7 @@ let gSyncUI = { this.onQuotaNotice(); break; case "weave:service:setup-complete": - this.onLoginFinish(); + this.onSetupComplete(); break; case "weave:service:login:start": this.onActivityStart();