Bug 1383338 - await shield recipe runner so recipes have a chance to see if this is first run r?mkelly
MozReview-Commit-ID: BAmWPQ3buaH
--- a/browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm
+++ b/browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm
@@ -52,20 +52,20 @@ this.RecipeRunner = {
// Run right now in dev mode
this.run();
}
if (prefs.getBoolPref(FIRST_RUN_PREF)) {
// Run once immediately after the UI is available. Do this before adding the
// timer so we can't end up racing it.
const observer = {
- observe: (subject, topic, data) => {
+ observe: async (subject, topic, data) => {
Services.obs.removeObserver(observer, UI_AVAILABLE_NOTIFICATION);
- this.run();
+ await this.run();
this.registerTimer();
prefs.setBoolPref(FIRST_RUN_PREF, false);
Services.obs.notifyObservers(null, SHIELD_INIT_NOTIFICATION);
},
};
Services.obs.addObserver(observer, UI_AVAILABLE_NOTIFICATION);
CleanupManager.addCleanupHandler(() => Services.obs.removeObserver(observer, UI_AVAILABLE_NOTIFICATION));