Leon 1 năm trước cách đây
mục cha
commit
7ece9c376b

+ 11 - 0
ios/AppDelegate.mm

@@ -522,5 +522,16 @@ initParams:
   self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(jumpNotificationSettingPage) userInfo:nil repeats:YES];
 }
 
+- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{
+  NSLog(@"%@",notification);
+  [UIApplication sharedApplication].applicationIconBadgeNumber = 100;
+  completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert);
+}
+
+- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
+    // 处理推送消息
+    NSLog(@"Received a notification: %@", notification.alertBody);
+}
+
 
 @end

+ 80 - 259
ios/NativeBridge.m

@@ -18,8 +18,6 @@
 @implementation NativeBridge
 @synthesize bridge = _bridge;
 
-// 定义一个自定义的 action 类型
-static NSString *const kMyCustomActionIdentifier = @"my_custom_action";
 
 RCT_EXPORT_MODULE()
 
@@ -234,164 +232,78 @@ RCT_EXPORT_METHOD(addSunPush:(id)array){
   [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
 }
 
-//- (void)addFSNotifications:(id)array{
-//  NSMutableArray *list = [NSMutableArray new];
-//  for (int i=0;i<[array count];i++){
-//    id detail = array[i];
-//    NSString *mode = detail[@"mode"];
-//    
-//    if (![mode isEqualToString:@"RECURRING"]){
-//      NSTimeInterval timestamp = [detail[@"once"] doubleValue]/1000; // 毫秒级时间戳
-//      // 获取当前时间
-//      NSDate *currentDate = [NSDate date];
-//      // 计算当前时间与给定时间戳之间的时间差(秒)
-//      NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
-//      if (timeInterval<0){
-//        continue;
-//      }
-//    }
-//    
-//    //设置通知内容
-//    UNMutableNotificationContent * content = [[UNMutableNotificationContent alloc] init];
-//    content.title = detail[@"title"];
-//    content.body = [NSString stringWithFormat:@"%@\nPress for actions >>",detail[@"body"]];
-//    content.sound = [UNNotificationSound defaultSound];
-//    content.badge = @([UIApplication sharedApplication].applicationIconBadgeNumber + 1);
-//    if (@available(iOS 15.0,*)){
-//      content.interruptionLevel = UNNotificationInterruptionLevelActive;
-//    }
-//    
-//    NSString *category_id = detail[@"category_id"];
-//    NSString *message_id = detail[@"id"];
-//    
-//    
-//    NSArray *actions;
-//    if ([category_id isEqualToString:@"REMINDER_FS_START_FAST"]||[category_id isEqualToString:@"REMINDER_FS_START_SLEEP"]){
-//      //消息的处理按钮
-//      UNNotificationAction *action1 = [UNNotificationAction actionWithIdentifier:@"START_TIMER_NOW" title:@"Start timer now with 1-tap" options:UNNotificationActionOptionForeground];
-//      
-//      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"PICK_EARLIER_START" title:@"Pick an earlier start" options:UNNotificationActionOptionForeground];
-//      
-//      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
-//      
-//      actions = @[action1,action2,action3];
-//    }
-//    else if([category_id isEqualToString:@"REMINDER_FS_END_FAST"]||[category_id isEqualToString:@"REMINDER_FS_END_SLEEP"]){
-//      //消息的处理按钮
-//      UNNotificationAction *action1 = [UNNotificationAction actionWithIdentifier:@"END_TIMER_NOW" title:@"End timer now with 1-tap" options:UNNotificationActionOptionForeground];
-//      
-//      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"PICK_EARLIER_END" title:@"Pick an earlier end" options:UNNotificationActionOptionForeground];
-//      
-//      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
-//      
-//      actions = @[action1,action2,action3];
-//    }
-//    else if ([category_id isEqualToString:@"REMINDER_FS_START_FAST_T2"]||
-//             [category_id isEqualToString:@"REMINDER_FS_START_FAST_T3"]||
-//             [category_id isEqualToString:@"REMINDER_FS_START_FAST_T4"]||
-//             [category_id isEqualToString:@"REMINDER_FS_START_SLEEP_T3"]||
-//             [category_id isEqualToString:@"REMINDER_FS_START_SLEEP_T4"]||
-//             [category_id isEqualToString:@"REMINDER_FS_END_SLEEP_T4"]){
-//      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"LOG_MY_TIMES" title:@"Log my times" options:UNNotificationActionOptionForeground];
-//      
-//      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
-//      
-//      actions = @[action2,action3];
-//    }
-//    
-//    NSDate *currentDate = [NSDate date];
-//    NSString *strID = [NSString stringWithFormat:@"%f",[currentDate timeIntervalSince1970]];
-//    UNNotificationCategory *categroy = [UNNotificationCategory categoryWithIdentifier:strID actions:actions intentIdentifiers:@[] options:UNNotificationCategoryOptionCustomDismissAction];
-//    [list addObject:categroy];
-//    //      [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categroy]];
-//    
-//    content.categoryIdentifier = strID;//category_id;
-//    
-//    if ([mode isEqualToString:@"RECURRING"]){
-//      //设置推送的触发机制
-//      NSArray *timeArray = [detail[@"recurring"][@"time"] componentsSeparatedByString:@":"];
-//      NSInteger hour = [[timeArray objectAtIndex:0] integerValue];
-//      NSInteger minute = [[timeArray objectAtIndex:1] integerValue];
-//      NSInteger second = [[timeArray objectAtIndex:2] integerValue];
-//      
-//      // 2. 设置触发条件
-//      NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
-//      dateComponents.hour = hour;
-//      dateComponents.minute = minute;
-//      dateComponents.second = second;
-//      UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:dateComponents repeats:YES];
-//      
-//      
-//      NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",message_id];
-//      UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
-//      [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
-//        
-//      }];
-//    }
-//    else {
-//      NSTimeInterval timestamp = [detail[@"once"] doubleValue]/1000; // 毫秒级时间戳
-//      // 获取当前时间
-//      NSDate *currentDate = [NSDate date];
-//      // 计算当前时间与给定时间戳之间的时间差(秒)
-//      NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
-//      
-//      UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timeInterval repeats:NO];
-//      NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",message_id];
-//      UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
-//      [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
-//        
-//      }];
-//    }
-//  }
-//  
-//  [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
-//}
-
-RCT_EXPORT_METHOD(addLocalPush:(id)array){
-  dispatch_async(dispatch_get_main_queue(), ^{
+- (void)addFSNotifications:(id)array{
+  NSMutableArray *list = [NSMutableArray new];
+  for (int i=0;i<[array count];i++){
+    id detail = array[i];
+    NSString *mode = detail[@"mode"];
     
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-    [center getPendingNotificationRequestsWithCompletionHandler:^(NSArray<UNNotificationRequest *> * _Nonnull requests) {
-      NSMutableArray *ids = [NSMutableArray new];
-      for (int i=0;i<requests.count;i++){
-        UNNotificationRequest *request = requests[i];
-        if ([request.identifier hasPrefix:@"REMINDER_FS_"]){
-          [ids addObject:request.identifier];
-        }
+    if (![mode isEqualToString:@"RECURRING"]){
+      NSTimeInterval timestamp = [detail[@"once"] doubleValue]/1000; // 毫秒级时间戳
+      // 获取当前时间
+      NSDate *currentDate = [NSDate date];
+      // 计算当前时间与给定时间戳之间的时间差(秒)
+      NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
+      if (timeInterval<0){
+        continue;
       }
-      [center removePendingNotificationRequestsWithIdentifiers:ids];
-      [center removeAllDeliveredNotifications];
-      [center removeAllPendingNotificationRequests];
-
-      [self addFSNotifications:array];
-    }];
+    }
     
+    NSString *category_id = detail[@"category_id"];
+    NSString *message_id = detail[@"id"];
     
+    //设置通知内容
+    UNMutableNotificationContent * content = [[UNMutableNotificationContent alloc] init];
+    content.title = detail[@"title"];
+    content.body = [NSString stringWithFormat:@"%@\nPress for actions >>",detail[@"body"]];
+    content.sound = [UNNotificationSound defaultSound];
+    content.badge = @([UIApplication sharedApplication].applicationIconBadgeNumber + 1);
+    content.categoryIdentifier = category_id;
+    if (@available(iOS 15.0,*)){
+      content.interruptionLevel = UNNotificationInterruptionLevelActive;
+    }
     
-  });
-}
-
-- (void)addFSNotifications:(id)array{
-  NSMutableArray *list = [NSMutableArray new];
-  for (int i=0;i<1;i++){
-    id detail = array[i];
-    NSString *mode = detail[@"mode"];
     
-    NSDate *currentDate = [NSDate date];
-    NSString *strID = [NSString stringWithFormat:@"%f",[currentDate timeIntervalSince1970]];
-    UNNotificationAction *action = [UNNotificationAction actionWithIdentifier:strID title:@"Action Title" options:UNNotificationActionOptionAuthenticationRequired];
-     
-    // 接着定义一个分类,并将动作添加到分类中
-    UNNotificationCategory *category = [UNNotificationCategory categoryWithIdentifier:strID actions:@[action] intentIdentifiers:@[] options:UNNotificationCategoryOptionCustomDismissAction];
-     
-    // 注册分类
-    [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObjects:category, nil]];
-     
-    // 创建本地推送内容
-    UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
-    content.title = @"Notification Title";
-    content.body = @"This is the notification body";
-    content.categoryIdentifier = strID; // 使用你刚刚定义的分类标识符
+    
+    
+    NSArray *actions;
+    if ([category_id isEqualToString:@"REMINDER_FS_START_FAST"]||[category_id isEqualToString:@"REMINDER_FS_START_SLEEP"]){
+      //消息的处理按钮
+      UNNotificationAction *action1 = [UNNotificationAction actionWithIdentifier:@"START_TIMER_NOW" title:@"Start timer now with 1-tap" options:UNNotificationActionOptionForeground];
+      
+      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"PICK_EARLIER_START" title:@"Pick an earlier start" options:UNNotificationActionOptionForeground];
+      
+      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
+      
+      actions = @[action1,action2,action3];
+    }
+    else if([category_id isEqualToString:@"REMINDER_FS_END_FAST"]||[category_id isEqualToString:@"REMINDER_FS_END_SLEEP"]){
+      //消息的处理按钮
+      UNNotificationAction *action1 = [UNNotificationAction actionWithIdentifier:@"END_TIMER_NOW" title:@"End timer now with 1-tap" options:UNNotificationActionOptionForeground];
+      
+      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"PICK_EARLIER_END" title:@"Pick an earlier end" options:UNNotificationActionOptionForeground];
+      
+      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
+      
+      actions = @[action1,action2,action3];
+    }
+    else if ([category_id isEqualToString:@"REMINDER_FS_START_FAST_T2"]||
+             [category_id isEqualToString:@"REMINDER_FS_START_FAST_T3"]||
+             [category_id isEqualToString:@"REMINDER_FS_START_FAST_T4"]||
+             [category_id isEqualToString:@"REMINDER_FS_START_SLEEP_T3"]||
+             [category_id isEqualToString:@"REMINDER_FS_START_SLEEP_T4"]||
+             [category_id isEqualToString:@"REMINDER_FS_END_SLEEP_T4"]){
+      UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"LOG_MY_TIMES" title:@"Log my times" options:UNNotificationActionOptionForeground];
+      
+      UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"SKIP" title:@"Skip" options:UNNotificationActionOptionAuthenticationRequired];
+      
+      actions = @[action2,action3];
+    }
+    
+    UNNotificationCategory *categroy = [UNNotificationCategory categoryWithIdentifier:category_id actions:actions intentIdentifiers:@[] options:UNNotificationCategoryOptionCustomDismissAction];
+    [list addObject:categroy];
+    //      [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:categroy]];
+    
     
     if ([mode isEqualToString:@"RECURRING"]){
       //设置推送的触发机制
@@ -408,7 +320,7 @@ RCT_EXPORT_METHOD(addLocalPush:(id)array){
       UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:dateComponents repeats:YES];
       
       
-      NSString * identifier = strID;
+      NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",message_id];
       UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
       [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
         
@@ -422,7 +334,7 @@ RCT_EXPORT_METHOD(addLocalPush:(id)array){
       NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
       
       UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timeInterval repeats:NO];
-      NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",@"sss"];
+      NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",message_id];
       UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
       [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
         
@@ -430,70 +342,22 @@ RCT_EXPORT_METHOD(addLocalPush:(id)array){
     }
   }
   
-//  [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
+  [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
 }
 
-
-RCT_EXPORT_METHOD(addLocalPushttt:(id)array){
+RCT_EXPORT_METHOD(addLocalPush:(id)array){
   dispatch_async(dispatch_get_main_queue(), ^{
-    return;
     UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-//    [center getPendingNotificationRequestsWithCompletionHandler:^(NSArray<UNNotificationRequest *> * _Nonnull requests) {
-//      NSMutableArray *ids = [NSMutableArray new];
-//      for (int i=0;i<requests.count;i++){
-//        UNNotificationRequest *request = requests[i];
-//        if ([request.identifier hasPrefix:@"REMINDER_FS_"]){
-//          [ids addObject:request.identifier];
-//        }
-//      }
-//      [center removePendingNotificationRequestsWithIdentifiers:ids];
-//      [self addFSNotifications:array];
-//    }];
-    
-    [center removeAllPendingNotificationRequests];
-    
-    UNMutableNotificationContent * content = [[UNMutableNotificationContent alloc] init];
-    content.title = @"aa";
-    content.body = @"bb";
-    content.sound = [UNNotificationSound defaultSound];
-    content.badge = @([UIApplication sharedApplication].applicationIconBadgeNumber + 1);
-    if (@available(iOS 15.0,*)){
-      content.interruptionLevel = UNNotificationInterruptionLevelActive;
-    }
-    
-    UNNotificationAction *customAction = [UNNotificationAction actionWithIdentifier:@"zzzz1"
-                                                                                  title:@"Custom Action"
-                                                                                options:UNNotificationActionOptionNone];
-        
-    UNNotificationCategory *categroy = [UNNotificationCategory categoryWithIdentifier:@"my_category"
-                                                                                  actions:@[customAction]
-                                                                        intentIdentifiers:@[]
-                                                                                  options:UNNotificationCategoryOptionCustomDismissAction];
-    
-    
-    NSMutableArray *list = [NSMutableArray new];
-    [list addObject:categroy];
-    
-    id detail = array[0];
-    //设置推送的触发机制
-    NSArray *timeArray = [detail[@"recurring"][@"time"] componentsSeparatedByString:@":"];
-    NSInteger hour = [[timeArray objectAtIndex:0] integerValue];
-    NSInteger minute = [[timeArray objectAtIndex:1] integerValue];
-    NSInteger second = [[timeArray objectAtIndex:2] integerValue];
-    
-    // 2. 设置触发条件
-    NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
-    dateComponents.hour = hour;
-    dateComponents.minute = minute;
-    dateComponents.second = second;
-    UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:dateComponents repeats:YES];
-    
-    [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithArray:list]];
-    
-    NSString * identifier = [NSString stringWithFormat:@"REMINDER_FS_%@",@"aaa"];
-    UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
-    [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
-      
+    [center getPendingNotificationRequestsWithCompletionHandler:^(NSArray<UNNotificationRequest *> * _Nonnull requests) {
+      NSMutableArray *ids = [NSMutableArray new];
+      for (int i=0;i<requests.count;i++){
+        UNNotificationRequest *request = requests[i];
+        if ([request.identifier hasPrefix:@"REMINDER_FS_"]){
+          [ids addObject:request.identifier];
+        }
+      }
+      [center removePendingNotificationRequestsWithIdentifiers:ids];
+      [self addFSNotifications:array];
     }];
     
     
@@ -501,49 +365,6 @@ RCT_EXPORT_METHOD(addLocalPushttt:(id)array){
   });
 }
 
-- (void)registerNotificationActions {
-    UNNotificationAction *customAction = [UNNotificationAction actionWithIdentifier:kMyCustomActionIdentifier
-                                                                              title:@"Custom Action"
-                                                                            options:UNNotificationActionOptionNone];
-    
-    UNNotificationCategory *category = [UNNotificationCategory categoryWithIdentifier:@"my_category"
-                                                                              actions:@[customAction]
-                                                                    intentIdentifiers:@[]
-                                                                              options:UNNotificationCategoryOptionNone];
-    
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-    [center setNotificationCategories:[NSSet setWithObject:category]];
-}
-
-// 创建并发送本地通知
-- (void)scheduleLocalNotification {
-    UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
-    content.title = @"Local Notification";
-    content.body = @"This is a local notification with a custom action.";
-    content.sound = [UNNotificationSound defaultSound];
-    content.categoryIdentifier = @"my_category";
-    
-    UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:10 repeats:NO];
-    
-    UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"my_notification"
-                                                                          content:content
-                                                                          trigger:trigger];
-    
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-  [self registerNotificationActions];
-//    [center addNotificationRequest:request withCompletionHandler:nil];
-}
-
-// 处理自定义 action 的点击事件
-- (void)userNotificationCenter:(UNUserNotificationCenter *)center
-didReceiveNotificationResponse:(UNNotificationResponse *)response
-         withCompletionHandler:(void(^)(void))completionHandler {
-    if ([response.actionIdentifier isEqualToString:kMyCustomActionIdentifier]) {
-        NSLog(@"Custom action was tapped!");
-    }
-    completionHandler();
-}
-
 
 @end
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
ios/main.jsbundle


+ 20 - 10
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -92,13 +92,14 @@ export default function IndexConsole(props: { record: any, count: number, access
             }
             nativePushListener = NativeAppEventEmitter.addListener('notificationReceive', (data) => {
                 console.log('notification receive action', data)
-                const { category_id, action_id, id, timestamp } = data
+                const { category_id, action_id, id } = data
+                const timestamp = new Date().getTime()
                 uploadLocalPushInfo({
                     messageId: id
                 })
                 global.set_time = timestamp;
                 setLogEvent('NOTIFY_ONE_TAP');
-                // setLogEvent(timestamp)
+                setLogEventTimestamp(timestamp)
                 switch (action_id) {
                     case 'START_TIMER_NOW':
                         {
@@ -214,9 +215,12 @@ export default function IndexConsole(props: { record: any, count: number, access
         }
         operateType = 'startFast'
         global.pauseIndexTimer = true
-        global.set_time = e ? new Date().getTime() : logEventTimestamp
+        global.set_time = new Date().getTime()
+
+        defaultTimestamp = new Date().getTime()
+        // global.set_time = e ? new Date().getTime() : logEventTimestamp
 
-        defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
+        // defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
         min = defaultTimestamp - 1 * 24 * 3600 * 1000
         max = defaultTimestamp
         isTimeout = false
@@ -251,12 +255,14 @@ export default function IndexConsole(props: { record: any, count: number, access
         }
         operateType = 'startSleep'
         global.pauseIndexTimer = true
-        global.set_time = e ? new Date().getTime() : logEventTimestamp
+        // global.set_time = e ? new Date().getTime() : logEventTimestamp
+        global.set_time = new Date().getTime()
 
 
         isTimeout = false
         if (props.record.scenario.name == 'SLEEP') {
-            defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
+            defaultTimestamp = new Date().getTime()
+            // defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
             min = defaultTimestamp - 6 * dayMilliSeconds
             max = defaultTimestamp
         }
@@ -312,7 +318,8 @@ export default function IndexConsole(props: { record: any, count: number, access
         }
         operateType = 'endSleep'
         global.pauseIndexTimer = true
-        global.set_time = e ? new Date().getTime() : logEventTimestamp
+        // global.set_time = e ? new Date().getTime() : logEventTimestamp
+        global.set_time = new Date().getTime()
 
         var real_start_time = props.record.current_record.sleep.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
@@ -329,7 +336,8 @@ export default function IndexConsole(props: { record: any, count: number, access
         }
         else {
             isTimeout = false
-            defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
+            // defaultTimestamp = e ? new Date().getTime() : logEventTimestamp
+            defaultTimestamp = new Date().getTime()
             min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds)
             max = defaultTimestamp
         }
@@ -409,11 +417,13 @@ export default function IndexConsole(props: { record: any, count: number, access
     function tapEndFastOperate(e) {
         operateType = 'endFast'
         global.pauseIndexTimer = true
-        global.set_time = e ? new Date().getTime() : logEventTimestamp
+        // global.set_time = e ? new Date().getTime() : logEventTimestamp
+        global.set_time = new Date().getTime()
 
         var real_start_time = props.record.current_record.fast.real_start_time
         var last_check_time = props.record.current_record.last_real_check_time
-        var now = e ? new Date().getTime() : logEventTimestamp
+        // var now = e ? new Date().getTime() : logEventTimestamp
+        var now = new Date().getTime()
         if (now - real_start_time >= dayMilliSeconds) {
             //严重超时
             isTimeout = true

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác