Skip to content

Commit 9f15a0f

Browse files
Show timestamps in EventVisualiser Details screen
1 parent 23f8f85 commit 9f15a0f

File tree

7 files changed

+119
-16
lines changed

7 files changed

+119
-16
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ playground.xcworkspace
5454
# you should judge for yourself, the pros and cons are mentioned at:
5555
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
5656
#
57-
# Pods/
57+
Pods/
58+
Podfile.lock
5859
#
5960
# Add this line if you want to avoid checking in source code from the Xcode workspace
6061
# *.xcworkspace

Clickstream.xcodeproj/project.pbxproj

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
9AF0C766280DECEB00E39A12 /* DeviceStatusNotifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA23D0324A99DCE001BE490 /* DeviceStatusNotifierTests.swift */; };
3434
9AF0C767280DECEE00E39A12 /* NetworkServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68E7BD89246034F90072549A /* NetworkServiceTests.swift */; };
3535
9AF0C768280DECF000E39A12 /* NetworkBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68E7BD8B246184310072549A /* NetworkBuilderTests.swift */; };
36+
A05E553E045C0919E173BA51 /* libPods-ClickstreamTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FEC9E6BADB7B135C83F3F43D /* libPods-ClickstreamTests.a */; };
37+
B8219E25486909930C78E57E /* libPods-Clickstream.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C92E3E094339437382E6B269 /* libPods-Clickstream.a */; };
3638
BD5E7BD42A0B94BF000F5678 /* Transport.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD5E7BB92A0B94BF000F5678 /* Transport.swift */; };
3739
BD5E7BD52A0B94BF000F5678 /* Transport.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD5E7BB92A0B94BF000F5678 /* Transport.swift */; };
3840
BD5E7BD62A0B94BF000F5678 /* FoundationTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD5E7BBA2A0B94BF000F5678 /* FoundationTransport.swift */; };
@@ -248,6 +250,10 @@
248250
/* End PBXCopyFilesBuildPhase section */
249251

250252
/* Begin PBXFileReference section */
253+
0B5A1B07D95778A6419E5CCB /* Pods-ClickstreamTests.integration.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClickstreamTests.integration.xcconfig"; path = "Target Support Files/Pods-ClickstreamTests/Pods-ClickstreamTests.integration.xcconfig"; sourceTree = "<group>"; };
254+
31E8D253A6AA418EC80DADE3 /* Pods-ClickstreamTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClickstreamTests.release.xcconfig"; path = "Target Support Files/Pods-ClickstreamTests/Pods-ClickstreamTests.release.xcconfig"; sourceTree = "<group>"; };
255+
40BB6FB02FC3439819A2DE89 /* Pods-Clickstream.production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Clickstream.production.xcconfig"; path = "Target Support Files/Pods-Clickstream/Pods-Clickstream.production.xcconfig"; sourceTree = "<group>"; };
256+
460F9F8AB43AE7C4459CF373 /* Pods-Clickstream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Clickstream.release.xcconfig"; path = "Target Support Files/Pods-Clickstream/Pods-Clickstream.release.xcconfig"; sourceTree = "<group>"; };
251257
681EAB3E248972E6003AB41A /* EventBatchProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = EventBatchProcessorTests.swift; path = ClickStreamTests/EventSchedulerTests/EventBatchProcessorTests.swift; sourceTree = SOURCE_ROOT; };
252258
681EAB4024897822003AB41A /* AppStateNotifierMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStateNotifierMock.swift; sourceTree = "<group>"; };
253259
68316328260CB2690095DBCA /* BatchSizeRegulatorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatchSizeRegulatorMock.swift; sourceTree = "<group>"; };
@@ -264,6 +270,10 @@
264270
68E7BD86246028CF0072549A /* SocketHandlerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketHandlerMock.swift; sourceTree = "<group>"; };
265271
68E7BD89246034F90072549A /* NetworkServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkServiceTests.swift; sourceTree = "<group>"; };
266272
68E7BD8B246184310072549A /* NetworkBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkBuilderTests.swift; sourceTree = "<group>"; };
273+
7282CB7D410BCA0090F3FD1C /* Pods-Clickstream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Clickstream.debug.xcconfig"; path = "Target Support Files/Pods-Clickstream/Pods-Clickstream.debug.xcconfig"; sourceTree = "<group>"; };
274+
8840BF54C358B8264F35000A /* Pods-Clickstream.alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Clickstream.alpha.xcconfig"; path = "Target Support Files/Pods-Clickstream/Pods-Clickstream.alpha.xcconfig"; sourceTree = "<group>"; };
275+
891A279414EADE779BB0B132 /* Pods-ClickstreamTests.production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClickstreamTests.production.xcconfig"; path = "Target Support Files/Pods-ClickstreamTests/Pods-ClickstreamTests.production.xcconfig"; sourceTree = "<group>"; };
276+
8B458AE3AF2EDBE66B51D6A1 /* Pods-ClickstreamTests.alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClickstreamTests.alpha.xcconfig"; path = "Target Support Files/Pods-ClickstreamTests/Pods-ClickstreamTests.alpha.xcconfig"; sourceTree = "<group>"; };
267277
9A6AEC9B2A43835A000A1D1D /* MockConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockConstants.swift; sourceTree = "<group>"; };
268278
9AA23CF524A33B4C001BE490 /* EventProcessorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventProcessorTest.swift; sourceTree = "<group>"; };
269279
9AA23CFA24A5978B001BE490 /* EventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventTests.swift; sourceTree = "<group>"; };
@@ -371,13 +381,18 @@
371381
BD8AF5E7287ED1CB002DD402 /* EventProcessorDependencies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventProcessorDependencies.swift; sourceTree = "<group>"; };
372382
BDDC872129E6AF580024ED8C /* FileManagerOverride.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManagerOverride.swift; sourceTree = "<group>"; };
373383
BDDC873529E7D6AC0024ED8C /* EteExperiment.pb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EteExperiment.pb.swift; sourceTree = "<group>"; };
384+
C079BA42E3CC787696935EE7 /* Pods-ClickstreamTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClickstreamTests.debug.xcconfig"; path = "Target Support Files/Pods-ClickstreamTests/Pods-ClickstreamTests.debug.xcconfig"; sourceTree = "<group>"; };
385+
C92E3E094339437382E6B269 /* libPods-Clickstream.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Clickstream.a"; sourceTree = BUILT_PRODUCTS_DIR; };
386+
DCD2A36A14B53616108A9EA8 /* Pods-Clickstream.integration.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Clickstream.integration.xcconfig"; path = "Target Support Files/Pods-Clickstream/Pods-Clickstream.integration.xcconfig"; sourceTree = "<group>"; };
387+
FEC9E6BADB7B135C83F3F43D /* libPods-ClickstreamTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ClickstreamTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
374388
/* End PBXFileReference section */
375389

376390
/* Begin PBXFrameworksBuildPhase section */
377391
68E7BADC244F08C00072549A /* Frameworks */ = {
378392
isa = PBXFrameworksBuildPhase;
379393
buildActionMask = 2147483647;
380394
files = (
395+
B8219E25486909930C78E57E /* libPods-Clickstream.a in Frameworks */,
381396
);
382397
runOnlyForDeploymentPostprocessing = 0;
383398
};
@@ -386,6 +401,7 @@
386401
buildActionMask = 2147483647;
387402
files = (
388403
68E7BD202456E6F10072549A /* libClickstream.a in Frameworks */,
404+
A05E553E045C0919E173BA51 /* libPods-ClickstreamTests.a in Frameworks */,
389405
);
390406
runOnlyForDeploymentPostprocessing = 0;
391407
};
@@ -395,6 +411,16 @@
395411
2E71FBE7FAE66AF83A297BB5 /* Pods */ = {
396412
isa = PBXGroup;
397413
children = (
414+
7282CB7D410BCA0090F3FD1C /* Pods-Clickstream.debug.xcconfig */,
415+
DCD2A36A14B53616108A9EA8 /* Pods-Clickstream.integration.xcconfig */,
416+
460F9F8AB43AE7C4459CF373 /* Pods-Clickstream.release.xcconfig */,
417+
8840BF54C358B8264F35000A /* Pods-Clickstream.alpha.xcconfig */,
418+
40BB6FB02FC3439819A2DE89 /* Pods-Clickstream.production.xcconfig */,
419+
C079BA42E3CC787696935EE7 /* Pods-ClickstreamTests.debug.xcconfig */,
420+
0B5A1B07D95778A6419E5CCB /* Pods-ClickstreamTests.integration.xcconfig */,
421+
31E8D253A6AA418EC80DADE3 /* Pods-ClickstreamTests.release.xcconfig */,
422+
8B458AE3AF2EDBE66B51D6A1 /* Pods-ClickstreamTests.alpha.xcconfig */,
423+
891A279414EADE779BB0B132 /* Pods-ClickstreamTests.production.xcconfig */,
398424
);
399425
path = Pods;
400426
sourceTree = "<group>";
@@ -425,6 +451,7 @@
425451
68E7BAE0244F08C00072549A /* Products */,
426452
2E71FBE7FAE66AF83A297BB5 /* Pods */,
427453
9AAFBB13247CBA15009BFDFB /* Recovered References */,
454+
F79786C0670697AED16D66CD /* Frameworks */,
428455
);
429456
sourceTree = "<group>";
430457
};
@@ -1137,13 +1164,23 @@
11371164
path = ETETestSuite;
11381165
sourceTree = "<group>";
11391166
};
1167+
F79786C0670697AED16D66CD /* Frameworks */ = {
1168+
isa = PBXGroup;
1169+
children = (
1170+
C92E3E094339437382E6B269 /* libPods-Clickstream.a */,
1171+
FEC9E6BADB7B135C83F3F43D /* libPods-ClickstreamTests.a */,
1172+
);
1173+
name = Frameworks;
1174+
sourceTree = "<group>";
1175+
};
11401176
/* End PBXGroup section */
11411177

11421178
/* Begin PBXNativeTarget section */
11431179
68E7BADE244F08C00072549A /* Clickstream */ = {
11441180
isa = PBXNativeTarget;
11451181
buildConfigurationList = 68E7BAE6244F08C00072549A /* Build configuration list for PBXNativeTarget "Clickstream" */;
11461182
buildPhases = (
1183+
6D438E80D266071CB140E900 /* [CP] Check Pods Manifest.lock */,
11471184
68E7BADB244F08C00072549A /* Sources */,
11481185
68E7BADC244F08C00072549A /* Frameworks */,
11491186
68E7BADD244F08C00072549A /* CopyFiles */,
@@ -1163,6 +1200,7 @@
11631200
isa = PBXNativeTarget;
11641201
buildConfigurationList = 68E7BD232456E6F10072549A /* Build configuration list for PBXNativeTarget "ClickstreamTests" */;
11651202
buildPhases = (
1203+
DF8500E4E2BB9BBE475E934C /* [CP] Check Pods Manifest.lock */,
11661204
68E7BD172456E6F10072549A /* Sources */,
11671205
68E7BD182456E6F10072549A /* Frameworks */,
11681206
68E7BD192456E6F10072549A /* Resources */,
@@ -1252,6 +1290,50 @@
12521290
shellPath = /bin/sh;
12531291
shellScript = "#if which swiftlint >/dev/null; then\n # swiftlint\n#else\n # echo \"warning: SwiftLint not installed, download from #https://github.com/realm/SwiftLint\"\n#fi\n";
12541292
};
1293+
6D438E80D266071CB140E900 /* [CP] Check Pods Manifest.lock */ = {
1294+
isa = PBXShellScriptBuildPhase;
1295+
buildActionMask = 2147483647;
1296+
files = (
1297+
);
1298+
inputFileListPaths = (
1299+
);
1300+
inputPaths = (
1301+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
1302+
"${PODS_ROOT}/Manifest.lock",
1303+
);
1304+
name = "[CP] Check Pods Manifest.lock";
1305+
outputFileListPaths = (
1306+
);
1307+
outputPaths = (
1308+
"$(DERIVED_FILE_DIR)/Pods-Clickstream-checkManifestLockResult.txt",
1309+
);
1310+
runOnlyForDeploymentPostprocessing = 0;
1311+
shellPath = /bin/sh;
1312+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1313+
showEnvVarsInLog = 0;
1314+
};
1315+
DF8500E4E2BB9BBE475E934C /* [CP] Check Pods Manifest.lock */ = {
1316+
isa = PBXShellScriptBuildPhase;
1317+
buildActionMask = 2147483647;
1318+
files = (
1319+
);
1320+
inputFileListPaths = (
1321+
);
1322+
inputPaths = (
1323+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
1324+
"${PODS_ROOT}/Manifest.lock",
1325+
);
1326+
name = "[CP] Check Pods Manifest.lock";
1327+
outputFileListPaths = (
1328+
);
1329+
outputPaths = (
1330+
"$(DERIVED_FILE_DIR)/Pods-ClickstreamTests-checkManifestLockResult.txt",
1331+
);
1332+
runOnlyForDeploymentPostprocessing = 0;
1333+
shellPath = /bin/sh;
1334+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1335+
showEnvVarsInLog = 0;
1336+
};
12551337
/* End PBXShellScriptBuildPhase section */
12561338

12571339
/* Begin PBXSourcesBuildPhase section */
@@ -1610,6 +1692,7 @@
16101692
};
16111693
68E7BAE7244F08C00072549A /* Debug */ = {
16121694
isa = XCBuildConfiguration;
1695+
baseConfigurationReference = 7282CB7D410BCA0090F3FD1C /* Pods-Clickstream.debug.xcconfig */;
16131696
buildSettings = {
16141697
CODE_SIGN_STYLE = Automatic;
16151698
OTHER_LDFLAGS = "-ObjC";
@@ -1623,6 +1706,7 @@
16231706
};
16241707
68E7BAE8244F08C00072549A /* Release */ = {
16251708
isa = XCBuildConfiguration;
1709+
baseConfigurationReference = 460F9F8AB43AE7C4459CF373 /* Pods-Clickstream.release.xcconfig */;
16261710
buildSettings = {
16271711
CODE_SIGN_STYLE = Automatic;
16281712
OTHER_LDFLAGS = "-ObjC";
@@ -1696,6 +1780,7 @@
16961780
};
16971781
68E7BB15245062B50072549A /* Integration */ = {
16981782
isa = XCBuildConfiguration;
1783+
baseConfigurationReference = DCD2A36A14B53616108A9EA8 /* Pods-Clickstream.integration.xcconfig */;
16991784
buildSettings = {
17001785
CODE_SIGN_STYLE = Automatic;
17011786
ONLY_ACTIVE_ARCH = NO;
@@ -1765,6 +1850,7 @@
17651850
};
17661851
68E7BB17245062C80072549A /* Production */ = {
17671852
isa = XCBuildConfiguration;
1853+
baseConfigurationReference = 40BB6FB02FC3439819A2DE89 /* Pods-Clickstream.production.xcconfig */;
17681854
buildSettings = {
17691855
CODE_SIGN_STYLE = Automatic;
17701856
OTHER_LDFLAGS = "-ObjC";
@@ -1834,6 +1920,7 @@
18341920
};
18351921
68E7BB19245062D20072549A /* Alpha */ = {
18361922
isa = XCBuildConfiguration;
1923+
baseConfigurationReference = 8840BF54C358B8264F35000A /* Pods-Clickstream.alpha.xcconfig */;
18371924
buildSettings = {
18381925
CODE_SIGN_STYLE = Automatic;
18391926
OTHER_LDFLAGS = "-ObjC";
@@ -1847,6 +1934,7 @@
18471934
};
18481935
68E7BD242456E6F10072549A /* Debug */ = {
18491936
isa = XCBuildConfiguration;
1937+
baseConfigurationReference = C079BA42E3CC787696935EE7 /* Pods-ClickstreamTests.debug.xcconfig */;
18501938
buildSettings = {
18511939
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
18521940
CODE_SIGN_STYLE = Manual;
@@ -1869,6 +1957,7 @@
18691957
};
18701958
68E7BD252456E6F10072549A /* Integration */ = {
18711959
isa = XCBuildConfiguration;
1960+
baseConfigurationReference = 0B5A1B07D95778A6419E5CCB /* Pods-ClickstreamTests.integration.xcconfig */;
18721961
buildSettings = {
18731962
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
18741963
CODE_SIGN_STYLE = Manual;
@@ -1891,6 +1980,7 @@
18911980
};
18921981
68E7BD262456E6F10072549A /* Release */ = {
18931982
isa = XCBuildConfiguration;
1983+
baseConfigurationReference = 31E8D253A6AA418EC80DADE3 /* Pods-ClickstreamTests.release.xcconfig */;
18941984
buildSettings = {
18951985
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
18961986
CODE_SIGN_STYLE = Manual;
@@ -1913,6 +2003,7 @@
19132003
};
19142004
68E7BD272456E6F10072549A /* Alpha */ = {
19152005
isa = XCBuildConfiguration;
2006+
baseConfigurationReference = 8B458AE3AF2EDBE66B51D6A1 /* Pods-ClickstreamTests.alpha.xcconfig */;
19162007
buildSettings = {
19172008
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
19182009
CODE_SIGN_STYLE = Manual;
@@ -1935,6 +2026,7 @@
19352026
};
19362027
68E7BD282456E6F10072549A /* Production */ = {
19372028
isa = XCBuildConfiguration;
2029+
baseConfigurationReference = 891A279414EADE779BB0B132 /* Pods-ClickstreamTests.production.xcconfig */;
19382030
buildSettings = {
19392031
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
19402032
CODE_SIGN_STYLE = Manual;

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ SPEC CHECKSUMS:
2424

2525
PODFILE CHECKSUM: 2c97fb10dcb1fcd309b15a9c7e84ddc137998638
2626

27-
COCOAPODS: 1.12.0
27+
COCOAPODS: 1.14.2

Sources/Clickstream/Core/Data/Constants/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ enum Constants {
5858
static var eventGuid = "meta.eventGuid"
5959
static var guid = "guid"
6060
static var eventTimestamp = "eventTimestamp"
61-
static var deviceTimestamp = "_deviceTimestamp"
61+
static var deviceTimestamp = "deviceTimestamp"
6262
}
6363
}

Sources/EventVisualizer/src/EventDetails/EventDetailsViewModel.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ final class EventDetailsViewModel: EventDetailsModelInput {
8888
(value as? Double != nil) ||
8989
(value is NSArray) ||
9090
/// checking if value is of enum type
91-
Mirror(reflecting: value).displayStyle?.equals(displayCase: .enum) ?? false ? true : false
92-
}
93-
if let timestamp = selectedMessage?["_\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
94-
displayedMessage?.append(("eventTimestamp", "\(timestamp.date)"))
91+
Mirror(reflecting: value).displayStyle?.equals(displayCase: .enum) ?? false ? true : false ||
92+
// checking if value is of Date type for showing SwiftProtobuf.Google_Protobuf_Timestamp.Date field's value in EV details screen
93+
(value is Date)
9594
}
9695
}
9796

Sources/EventVisualizer/src/EventsList/EventsListViewModel.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ final class EventsListViewModel: EventsListViewModelInput {
4949
var state = ""
5050
if let message = messages[index.row] as? CollectionMapper {
5151
if let eventGuid = message.asDictionary[Constants.EventVisualizer.eventGuid] as? String {
52-
if let timestamp = message.asDictionary["_\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
53-
eventTimeStamp = "\(timestamp.date)"
54-
} else if let timestamp = message.asDictionary["\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
55-
eventTimeStamp = "\(timestamp.date)"
52+
if let timestamp = message.asDictionary["_\(Constants.EventVisualizer.eventTimestamp)"] as? Date {
53+
eventTimeStamp = "\(timestamp)"
54+
} else if let timestamp = message.asDictionary["\(Constants.EventVisualizer.eventTimestamp)"] as? Date {
55+
eventTimeStamp = "\(timestamp)"
5656
}
5757
state = EventsHelper.shared.getState(of: eventGuid)
5858
} else if let eventGuid = message.asDictionary["storage.\(Constants.EventVisualizer.eventGuid)"] as? String,
59-
let timestamp = message.asDictionary["storage.\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
60-
eventTimeStamp = "\(timestamp.date)"
59+
let timestamp = message.asDictionary["storage.\(Constants.EventVisualizer.eventTimestamp)"] as? Date {
60+
eventTimeStamp = "\(timestamp)"
6161
state = EventsHelper.shared.getState(of: eventGuid)
6262
} else if let eventGuid = message.asDictionary["\(Constants.EventVisualizer.guid)"] as? String,
63-
let timestamp = message.asDictionary["\(Constants.EventVisualizer.deviceTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
64-
eventTimeStamp = "\(timestamp.date)"
63+
let timestamp = message.asDictionary["\(Constants.EventVisualizer.deviceTimestamp)"] as? Date {
64+
eventTimeStamp = "\(timestamp)"
6565
state = EventsHelper.shared.getState(of: eventGuid)
6666
}
6767
}

0 commit comments

Comments
 (0)