|
@@ -13,13 +13,12 @@ function addBlueDevice(device) {
|
|
|
// 同一个设备处理
|
|
|
var pages = getCurrentPages();
|
|
|
var deviceList = pages[0].getDeviceList();
|
|
|
- var tempList = deviceList.filter((v) => v.deviceId === device.deviceId);
|
|
|
- const strings = require('../strings');
|
|
|
- if (!strings.isEmpty(tempList)) {
|
|
|
- deviceList = tempList.filter((v) => v.deviceId !== device.deviceId);
|
|
|
- }
|
|
|
+ var finalList = deviceList.filter((v) => {
|
|
|
+ return v.deviceId != device.deviceId;
|
|
|
+ });
|
|
|
+
|
|
|
/// 添加到第一个
|
|
|
- deviceList.unshift({
|
|
|
+ finalList.unshift({
|
|
|
connectType: 1,
|
|
|
devName: device.name,
|
|
|
state: "online",
|
|
@@ -30,7 +29,7 @@ function addBlueDevice(device) {
|
|
|
clientType: device.clientType || device.ProdModel,
|
|
|
imageUrl: device.imageUrl,
|
|
|
});
|
|
|
- return deviceList;
|
|
|
+ return finalList;
|
|
|
};
|
|
|
|
|
|
// 新添加Wifi设备 猫王小王子OTR-X
|