Skip to content

Commit 578473d

Browse files
committed
Rebased
1 parent a1ee7c1 commit 578473d

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/js/port_handler.js

Lines changed: 5 additions & 2 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();

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
@@ -131,25 +131,23 @@ options.initAutoConnectConnectionTimeout = function () {
131131

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

142141
options.initShowVirtualMode = function() {
143142
const showVirtualModeElement = $('div.showVirtualMode input');
144-
ConfigStorage.get('showVirtualMode', result => {
145-
showVirtualModeElement
146-
.prop('checked', !!result.showVirtualMode)
147-
.on('change', () => {
148-
ConfigStorage.set({ showVirtualMode: showVirtualModeElement.is(':checked') });
149-
PortHandler.initialPorts = false;
150-
})
151-
.trigger('change');
152-
});
143+
const result = ConfigStorage.get('showVirtualMode');
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');
153151
};
154152

155153
options.initCordovaForceComputerUI = function () {

0 commit comments

Comments
 (0)