commit 8bf4c86eef10bfa3f3e952f4c64ac3da604ff4f9
parent 8fc953f86aa027f42788918f1af69a1640f2b750
Author: Jens Stutte <jstutte@mozilla.com>
Date: Thu, 16 Oct 2025 15:02:15 +0000
Bug 1991851 - ActivityStream._updateDynamicPrefs should remove the REGION_TOPIC observer once it's obsolete. r=home-newtab-reviewers,thecount
Differential Revision: https://phabricator.services.mozilla.com/D267530
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/newtab/lib/ActivityStream.sys.mjs b/browser/extensions/newtab/lib/ActivityStream.sys.mjs
@@ -1633,6 +1633,7 @@ export class ActivityStream {
if (this.geo === "") {
Services.obs.removeObserver(this, lazy.Region.REGION_TOPIC);
}
+ delete this.geo;
Services.obs.removeObserver(this, "intl:app-locales-changed");
@@ -1645,6 +1646,10 @@ export class ActivityStream {
_updateDynamicPrefs() {
// Save the geo pref if we have it
if (lazy.Region.home) {
+ if (this.geo === "") {
+ // The observer has become obsolete.
+ Services.obs.removeObserver(this, lazy.Region.REGION_TOPIC);
+ }
this.geo = lazy.Region.home;
} else if (this.geo !== "") {
// Watch for geo changes and use a dummy value for now