mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1485661 - Adapt tabListChanged to new front. r=yulia
MozReview-Commit-ID: 8LcTfats8c8 Depends on D8824 Differential Revision: https://phabricator.services.mozilla.com/D8825 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
354db59f74
commit
282edc25f7
@ -60,7 +60,7 @@ function debugTargetListenerMiddleware(store) {
|
||||
const { client } = runtime.runtimeDetails;
|
||||
|
||||
if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.TAB)) {
|
||||
client.addListener("tabListChanged", onTabsUpdated);
|
||||
client.mainRoot.on("tabListChanged", onTabsUpdated);
|
||||
}
|
||||
|
||||
if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.EXTENSION)) {
|
||||
@ -81,7 +81,7 @@ function debugTargetListenerMiddleware(store) {
|
||||
const { client } = runtime.runtimeDetails;
|
||||
|
||||
if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.TAB)) {
|
||||
client.removeListener("tabListChanged", onTabsUpdated);
|
||||
client.mainRoot.off("tabListChanged", onTabsUpdated);
|
||||
}
|
||||
|
||||
if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.EXTENSION)) {
|
||||
|
@ -42,13 +42,13 @@ class TabsPanel extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
const { client } = this.props;
|
||||
client.addListener("tabListChanged", this.update);
|
||||
client.mainRoot.on("tabListChanged", this.update);
|
||||
this.update();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
const { client } = this.props;
|
||||
client.removeListener("tabListChanged", this.update);
|
||||
client.mainRoot.off("tabListChanged", this.update);
|
||||
}
|
||||
|
||||
async update() {
|
||||
|
@ -59,13 +59,13 @@ TabStore.prototype = {
|
||||
_onStatusChanged: function() {
|
||||
if (this._connection.status == Connection.Status.CONNECTED) {
|
||||
// Watch for changes to remote browser tabs
|
||||
this._connection.client.addListener("tabListChanged",
|
||||
this._connection.client.mainRoot.on("tabListChanged",
|
||||
this._onTabListChanged);
|
||||
this.listTabs();
|
||||
} else {
|
||||
if (this._connection.client) {
|
||||
this._connection.client.removeListener("tabListChanged",
|
||||
this._onTabListChanged);
|
||||
this._connection.client.mainRoot.off("tabListChanged",
|
||||
this._onTabListChanged);
|
||||
}
|
||||
this._resetStore();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user