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:
Alexandre Poirot 2018-10-30 08:08:40 +00:00
parent 354db59f74
commit 282edc25f7
3 changed files with 7 additions and 7 deletions

View File

@ -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)) {

View File

@ -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() {

View File

@ -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();
}