Backed out changeset 03cfb27bc3a2 (bug 1881107) for causing bc failures in browser_opentabs_pinned_tabs.js CLOSED TREE

This commit is contained in:
Cristian Tuns
2024-04-04 17:38:48 -04:00
parent 82c0648a2e
commit e67e7c25d4

View File

@@ -38,9 +38,6 @@ ChromeUtils.defineLazyGetter(lazy, "fxAccounts", () => {
).getFxAccountsSingleton();
});
const TOPIC_DEVICESTATE_CHANGED = "firefox-view.devicestate.changed";
const TOPIC_DEVICELIST_UPDATED = "fxaccounts:devicelist_updated";
/**
* A collection of open tabs grouped by window.
*
@@ -674,7 +671,6 @@ class OpenTabsContextMenu extends MozLitElement {
constructor() {
super();
this.triggerNode = null;
this.boundObserve = (...args) => this.observe(...args);
this.devices = [];
}
@@ -686,28 +682,6 @@ class OpenTabsContextMenu extends MozLitElement {
return this.ownerDocument.querySelector("view-opentabs");
}
connectedCallback() {
super.connectedCallback();
this.fetchDevicesPromise = this.fetchDevices();
Services.obs.addObserver(this.boundObserve, TOPIC_DEVICELIST_UPDATED);
Services.obs.addObserver(this.boundObserve, TOPIC_DEVICESTATE_CHANGED);
}
disconnectedCallback() {
super.disconnectedCallback();
Services.obs.removeObserver(this.boundObserve, TOPIC_DEVICELIST_UPDATED);
Services.obs.removeObserver(this.boundObserve, TOPIC_DEVICESTATE_CHANGED);
}
observe(_subject, topic, _data) {
if (
topic == TOPIC_DEVICELIST_UPDATED ||
topic == TOPIC_DEVICESTATE_CHANGED
) {
this.fetchDevicesPromise = this.fetchDevices();
}
}
async fetchDevices() {
const currentWindow = this.ownerViewPage.getWindow();
if (currentWindow?.gSync) {
@@ -727,7 +701,7 @@ class OpenTabsContextMenu extends MozLitElement {
return;
}
this.triggerNode = triggerNode;
await this.fetchDevicesPromise;
await this.fetchDevices();
await this.getUpdateComplete();
this.panelList.toggle(originalEvent);
}