فهرست منبع

- 홈허브 선택화면 위치 이동

KaRam Kim 8 سال پیش
والد
کامیت
46f2106a00
1فایلهای تغییر یافته به همراه14 افزوده شده و 2 حذف شده
  1. 14 2
      OneCable/Classes/ViewControllers/ThingsScreens/ThingsViewController.m

+ 14 - 2
OneCable/Classes/ViewControllers/ThingsScreens/ThingsViewController.m

@@ -37,6 +37,8 @@
 #import "ThingsForcedDelViewController.h"
 #import "ThingsGeneralDelViewController.h"
 
+#import "HomeHubSelectPopupView.h"
+
 #define kfThingsTableViewCellHeight 100.0f
 #define kiCellInset 5
 #define kiCellItem 2
@@ -461,8 +463,18 @@
 - (void)addNewDevice {
     
     ThingsAddViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddViewController" storyboardName:@"Things"];
-    vc.selectHub = _selectHub;
-    [self presentViewController:vc animated:YES completion:nil];
+    if ([[JDFacade facade].loginUser isMultiHomeHub] && _selectHub == nil) {
+        HomeHubSelectPopupView *hpopup = [[HomeHubSelectPopupView alloc] initFromNib];
+        [hpopup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
+            if (buttonIndex == 0) {
+                vc.selectHub = hpopup.selectedDeviceModel;
+                [self presentViewController:vc animated:YES completion:nil];
+            }
+        }];
+    } else {
+        vc.selectHub = _selectHub;
+        [self presentViewController:vc animated:YES completion:nil];
+    }
 }
 
 - (void)refreshDeviceList {