mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-10 16:23:40 +00:00
replace indexOf with includes where possible
This commit is contained in:
+1
-1
@@ -118,7 +118,7 @@ function searchBonjour(pluginType, pluginConfig) {
|
||||
bonjour.find({ type: pluginConfig.searchOptions.bonjourName }, (e) => {
|
||||
const validAddresses = [];
|
||||
e.addresses.forEach((address) => {
|
||||
if (address.indexOf(':') === -1) {
|
||||
if (!address.includes(':')) {
|
||||
validAddresses.push(address);
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
@@ -144,7 +144,7 @@ function switchDevice(id) {
|
||||
if (pinnedDevices.length > 0) {
|
||||
cols += pinnedDevices.length;
|
||||
}
|
||||
if (pinnedDevices.indexOf(activeDevice) >= 0 || id === undefined) {
|
||||
if (pinnedDevices.includes(activeDevice) || id === undefined) {
|
||||
cols--;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ module.exports.pinActiveDevice = function pinActiveDevice() {
|
||||
if (activeDevice === undefined) {
|
||||
return;
|
||||
}
|
||||
if (pinnedDevices.indexOf(DEVICE.all[activeDevice.id]) === -1) {
|
||||
if (!pinnedDevices.includes(DEVICE.all[activeDevice.id])) {
|
||||
pinnedDevices.push(DEVICE.all[activeDevice.id]);
|
||||
}
|
||||
DEVICE.changeActivePinIndex(true);
|
||||
|
||||
Reference in New Issue
Block a user