From 149adc620e7e120ee2adaa406a5302c9a0a2eff3 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 一月 2020 17:26:23 +0800
Subject: [PATCH] 2020-01-10 1.优化。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
index dc4b14f..1ddb314 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -457,7 +457,17 @@
                     var revertRoomData = mResidenceRes.PageData;
                     if (revertRoomData.Find ((obj) => obj.Id == UserConfig.Instance.CurrentRegion.Id) == null) {
                         if (revertRoomData != null && revertRoomData.Count > 0) {
-                            UserConfig.Instance.CurrentRegion = revertRoomData [0];
+                            var bFind = false;
+                            foreach(var mHome in revertRoomData) {
+                                if (UserConfig.Instance.CheckThisHomeGatewaysNotEmpty (mHome)) {
+                                    bFind = true;
+                                    UserConfig.Instance.CurrentRegion = mHome;
+                                    break;
+                                }
+                            }
+                            if (!bFind) {
+                                UserConfig.Instance.CurrentRegion = revertRoomData [0];
+                            }
                             //if (UserConfig.Instance.CheckHomeGateways ()) {
                             //    UserConfig.Instance.GatewayMAC = revertRoomData [0].HomeGateways [0].GatewayUniqueId;
                             //}

--
Gitblit v1.8.0