Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

fix delete event

roryclear8f1d30f3b41a
diff --git a/clearcam/FileServer.m b/clearcam/FileServer.m
index 71c0c15..6610ec3 100644
--- a/clearcam/FileServer.m
+++ b/clearcam/FileServer.m
@@ -416,6 +416,13 @@
BOOL success = [self deleteEventWithTimeStamp:timeStamp];
if (success) {
+
+ //TODO//
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"LastDeletedDayIndex"];
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"LastDeletedSegmentIndex"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+ //THIS WILL BE SLOW LONG TERM, use a queue or something
+
NSString *httpHeader = @"HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n";
NSString *successMessage = @"{\"success\": \"Event deleted\"}";
send(clientSocket, [httpHeader UTF8String], httpHeader.length, 0);
diff --git a/clearcam/ViewController.m b/clearcam/ViewController.m
index 17a4b55..cb44e27 100644
--- a/clearcam/ViewController.m
+++ b/clearcam/ViewController.m
@@ -531,7 +531,6 @@ NSMutableDictionary *classColorMap;
if (!eventDataArray || eventDataArray.count == 0) {
NSLog(@"No event timestamps found.");
- return;
}
NSMutableArray<NSNumber *> *eventTimestamps = [NSMutableArray array];