From d616b67bd6ea95562af73a00bf0aab38eec935df Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 11 十二月 2020 13:37:26 +0800
Subject: [PATCH] 2020-12-11 1.取消屏幕常亮。2.优化iOS接收推送处理。

---
 HDL_ON/Entity/FunctionList.cs |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 22da38f..37990d5 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -112,6 +112,11 @@
                 var functionDataBytes = FileUtils.ReadFile(filePath);
                 var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes);
                 var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
+                if (tempFunction == null)
+                {
+                    FileUtils.DeleteFile(filePath);
+                    return;
+                }
                 if (tempFunction.DeleteSign)
                 {
                     //todo 鍒犻櫎浜戠鏁版嵁 20201203--App涓嶈兘鍒犻櫎鍔熻兘鏁版嵁
@@ -365,8 +370,9 @@
                         //    }
                         //})
                         //{ IsBackground = true }.Start();
-                        foreach (var localFunction in List.GetAllDeviceFunctionList())
+                        for (int i =0;i < List.GetAllDeviceFunctionList().Count;)
                         {
+                            var localFunction = List.GetAllDeviceFunctionList()[0];
                             var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                             if (newFunction == null)//濡傛灉浜戠鏈�鏂版暟鎹病鏈夎鏉℃暟鎹紝鍒欐湰鍦伴渶瑕佸垹鎺夎鏁版嵁璁板綍
                             {
@@ -374,6 +380,7 @@
                             }
                             else
                             {
+                                i++;
                                 if (localFunction.modifyTime != newFunction.modifyTime)
                                 {
                                     localFunction.name = newFunction.name;
@@ -426,8 +433,9 @@
                         //    }
                         //})
                         //{ IsBackground = true }.Start();
-                        foreach (var localScene in List.scenes)
+                        for(int i=0;i<List.scenes.Count;)
                         {
+                            var localScene = List.scenes[i];
                             var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId);
                             if (newScene == null)//濡傛灉浜戠鏈�鏂版暟鎹病鏈夎鏉℃暟鎹紝鍒欐湰鍦伴渶瑕佸垹鎺夎鏁版嵁璁板綍
                             {
@@ -435,6 +443,7 @@
                             }
                             else
                             {
+                                i++;
                                 if (localScene.modifyTime != newScene.modifyTime)
                                 {
                                     localScene.name = newScene.name;

--
Gitblit v1.8.0