зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1689383 - Fixing usage of region updated const r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D103382
This commit is contained in:
Родитель
96e56e3d39
Коммит
74f4554aac
|
@ -147,11 +147,9 @@ class RegionHomeObserver {
|
|||
observe(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case Region.REGION_TOPIC:
|
||||
if (aData === Region.REGION_UPDATED) {
|
||||
Services.obs.removeObserver(this, Region.REGION_TOPIC);
|
||||
this.regionHomeDeferred.resolve(Region.home);
|
||||
this.regionHomeDeferred = null;
|
||||
}
|
||||
Services.obs.removeObserver(this, Region.REGION_TOPIC);
|
||||
this.regionHomeDeferred.resolve(Region.home);
|
||||
this.regionHomeDeferred = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -831,9 +831,7 @@ this.ActivityStream = class ActivityStream {
|
|||
observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case Region.REGION_TOPIC:
|
||||
if (data === Region.REGION_UPDATED) {
|
||||
this._updateDynamicPrefs();
|
||||
}
|
||||
this._updateDynamicPrefs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -255,14 +255,12 @@ this.PrefsFeed = class PrefsFeed {
|
|||
observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case Region.REGION_TOPIC:
|
||||
if (data === Region.REGION_UPDATED) {
|
||||
this.store.dispatch(
|
||||
ac.BroadcastToContent({
|
||||
type: at.PREF_CHANGED,
|
||||
data: { name: "region", value: Region.home },
|
||||
})
|
||||
);
|
||||
}
|
||||
this.store.dispatch(
|
||||
ac.BroadcastToContent({
|
||||
type: at.PREF_CHANGED,
|
||||
data: { name: "region", value: Region.home },
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,11 +93,7 @@ describe("ActivityStream", () => {
|
|||
describe("#observe", () => {
|
||||
it("should call _updateDynamicPrefs from observe", () => {
|
||||
sandbox.stub(as, "_updateDynamicPrefs");
|
||||
as.observe(
|
||||
undefined,
|
||||
global.Region.REGION_TOPIC,
|
||||
global.Region.REGION_UPDATED
|
||||
);
|
||||
as.observe(undefined, global.Region.REGION_TOPIC);
|
||||
assert.calledOnce(as._updateDynamicPrefs);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -237,11 +237,7 @@ describe("PrefsFeed", () => {
|
|||
});
|
||||
describe("#observe", () => {
|
||||
it("should call dispatch from observe", () => {
|
||||
feed.observe(
|
||||
undefined,
|
||||
global.Region.REGION_TOPIC,
|
||||
global.Region.REGION_UPDATED
|
||||
);
|
||||
feed.observe(undefined, global.Region.REGION_TOPIC);
|
||||
assert.calledOnce(feed.store.dispatch);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -2547,10 +2547,8 @@ SearchService.prototype = {
|
|||
});
|
||||
break;
|
||||
case Region.REGION_TOPIC:
|
||||
if (verb == Region.REGION_UPDATED) {
|
||||
logConsole.debug("Region updated:", Region.home);
|
||||
this._maybeReloadEngines().catch(Cu.reportError);
|
||||
}
|
||||
logConsole.debug("Region updated:", Region.home);
|
||||
this._maybeReloadEngines().catch(Cu.reportError);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче