mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 11:28:38 +00:00
Bug 919681 - Remove duplicate simulator connected handlers. r=ochameau
This commit is contained in:
parent
82c1d66218
commit
fdb80c5b40
@ -61,6 +61,9 @@ let UI = {
|
||||
|
||||
this.template = new Template(document.body, this.store, Utils.l10n);
|
||||
this.template.start();
|
||||
|
||||
this._onSimulatorConnected = this._onSimulatorConnected.bind(this);
|
||||
this._onSimulatorDisconnected = this._onSimulatorDisconnected.bind(this);
|
||||
},
|
||||
|
||||
useFloatingScrollbarsIfNeeded: function() {
|
||||
@ -136,16 +139,25 @@ let UI = {
|
||||
this.connection.log("Simulator ready. Connecting.");
|
||||
this.connection.port = port;
|
||||
this.connection.host = "localhost";
|
||||
this.connection.once("connected", () => {
|
||||
this.connection.log("Connected to simulator.");
|
||||
this.connection.keepConnecting = false;
|
||||
});
|
||||
this.connection.once("connected",
|
||||
this._onSimulatorConnected);
|
||||
this.connection.once("disconnected",
|
||||
this._onSimulatorDisconnected);
|
||||
this.connection.keepConnecting = true;
|
||||
this.connection.connect();
|
||||
});
|
||||
document.body.classList.remove("show-simulators");
|
||||
},
|
||||
|
||||
_onSimulatorConnected: function() {
|
||||
this.connection.log("Connected to simulator.");
|
||||
this.connection.keepConnecting = false;
|
||||
},
|
||||
|
||||
_onSimulatorDisconnected: function() {
|
||||
this.connection.off("connected", this._onSimulatorConnected);
|
||||
},
|
||||
|
||||
connectToAdbDevice: function(name) {
|
||||
let device = Devices.getByName(name);
|
||||
device.connect().then((port) => {
|
||||
|
Loading…
Reference in New Issue
Block a user