Bug 1390042 - [Onboarding] The complete sign is not shown at first time when set the performance tour as the first item;r=rexboy
MozReview-Commit-ID: AVv4pcBfTbf
--- a/browser/extensions/onboarding/content/onboarding.js
+++ b/browser/extensions/onboarding/content/onboarding.js
@@ -489,22 +489,16 @@ class Onboarding {
this._removeTourFromNotificationQueue(this._notificationBar.dataset.targetTourId);
break;
case "onboarding-notification-action-btn":
let tourId = this._notificationBar.dataset.targetTourId;
this.toggleOverlay();
this.gotoPage(tourId);
this._removeTourFromNotificationQueue(tourId);
break;
- // These tours are tagged completed instantly upon showing.
- case "onboarding-tour-default-browser":
- case "onboarding-tour-sync":
- case "onboarding-tour-performance":
- this.setToursCompleted([ evt.target.id ]);
- break;
}
let classList = evt.target.classList;
if (classList.contains("onboarding-tour-item")) {
this.gotoPage(evt.target.id);
} else if (classList.contains("onboarding-tour-action-button")) {
let activeItem = this._tourItems.find(item => item.classList.contains("onboarding-active"));
this.setToursCompleted([ activeItem.id ]);
}
@@ -554,16 +548,25 @@ class Onboarding {
}
for (let li of this._tourItems) {
if (li.id == tourId) {
li.classList.add("onboarding-active");
} else {
li.classList.remove("onboarding-active");
}
}
+
+ switch (tourId) {
+ // These tours should tagged completed instantly upon showing.
+ case "onboarding-tour-default-browser":
+ case "onboarding-tour-sync":
+ case "onboarding-tour-performance":
+ this.setToursCompleted([tourId]);
+ break;
+ }
}
isTourCompleted(tourId) {
return Services.prefs.getBoolPref(`browser.onboarding.tour.${tourId}.completed`, false);
}
setToursCompleted(tourIds) {
let params = [];