Skip to content

Commit 753cda8

Browse files
committed
Rebased
1 parent e986b4e commit 753cda8

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/js/port_handler.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ PortHandler.initialize = function () {
3232

3333
PortHandler.check = function () {
3434
const self = this;
35+
let result;
3536

36-
ConfigStorage.get('showVirtualMode', res => self.showVirtualMode = res.showVirtualMode);
37-
ConfigStorage.get('showAllSerialDevices', res => self.showAllSerialDevices = res.showAllSerialDevices);
37+
result = ConfigStorage.get('showVirtualMode');
38+
self.showVirtualMode = result.showVirtualMode;
39+
result = ConfigStorage.get('showAllSerialDevices');
40+
self.showAllSerialDevices = result.showAllSerialDevices;
3841

3942
self.check_usb_devices();
4043
self.check_serial_devices();
@@ -168,7 +171,7 @@ PortHandler.detectPort = function(currentPorts) {
168171
currentPorts = self.updatePortSelect(currentPorts);
169172
console.log(`PortHandler - Found: ${JSON.stringify(newPorts)}`);
170173

171-
let result = ConfigStorage.get('last_used_port');
174+
const result = ConfigStorage.get('last_used_port');
172175
if (result.last_used_port) {
173176
if (result.last_used_port.includes('tcp')) {
174177
self.portPickerElement.val('manual');

src/js/serial.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ const serial = {
272272
const devices = [];
273273

274274
devices_array.forEach(function (device) {
275-
const showAllSerialDevices = ConfigStorage.get('showAllSerialDevices');
276275
const isKnownSerialDevice = self.serialDevices.some(el => el.vendorId === device.vendorId) && self.serialDevices.some(el => el.productId === device.productId);
277276

278277
if (isKnownSerialDevice || PortHandler.showAllSerialDevices) {

src/js/tabs/options.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,25 +130,23 @@ options.initAutoConnectConnectionTimeout = function () {
130130

131131
options.initShowAllSerialDevices = function() {
132132
const showAllSerialDevicesElement = $('div.showAllSerialDevices input');
133-
ConfigStorage.get('showAllSerialDevices', result => {
134-
showAllSerialDevicesElement
135-
.prop('checked', !!result.showAllSerialDevices)
136-
.on('change', () => ConfigStorage.set({ showAllSerialDevices: showAllSerialDevicesElement.is(':checked') }))
137-
.trigger('change');
138-
});
133+
const result = ConfigStorage.get('showAllSerialDevices');
134+
showAllSerialDevicesElement
135+
.prop('checked', !!result.showAllSerialDevices)
136+
.on('change', () => ConfigStorage.set({ showAllSerialDevices: showAllSerialDevicesElement.is(':checked') }))
137+
.trigger('change');
139138
};
140139

141140
options.initShowVirtualMode = function() {
142141
const showVirtualModeElement = $('div.showVirtualMode input');
143-
ConfigStorage.get('showVirtualMode', result => {
144-
showVirtualModeElement
145-
.prop('checked', !!result.showVirtualMode)
146-
.on('change', () => {
147-
ConfigStorage.set({ showVirtualMode: showVirtualModeElement.is(':checked') });
148-
PortHandler.initialPorts = false;
149-
})
150-
.trigger('change');
151-
});
142+
const result = ConfigStorage.get('showVirtualMode');
143+
showVirtualModeElement
144+
.prop('checked', !!result.showVirtualMode)
145+
.on('change', () => {
146+
ConfigStorage.set({ showVirtualMode: showVirtualModeElement.is(':checked') });
147+
PortHandler.initialPorts = false;
148+
})
149+
.trigger('change');
152150
};
153151

154152
options.initCordovaForceComputerUI = function () {

0 commit comments

Comments
 (0)