Skip to content

Commit

Permalink
Update EventsListViewModel.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
RishavG96 authored Apr 18, 2024
1 parent 326c628 commit c3361be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/EventVisualizer/src/EventsList/EventsListViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ final class EventsListViewModel: EventsListViewModelInput {
let timestamp = message.asDictionary["storage.\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
eventTimeStamp = "\(timestamp.date)"
state = EventsHelper.shared.getState(of: eventGuid)
} else if let eventGuid = message.asDictionary["storage.meta.storage.\(Constants.EventVisualizer.eventGID)"] as? String,
let timestamp = message.asDictionary["storage.\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
eventTimeStamp = "\(timestamp.date)"
} else if let eventGuid = message.asDictionary["storage.meta.storage.\(Constants.EventVisualizer.eventGID)"] as? String {
if let timestamp = message.asDictionary["storage.\(Constants.EventVisualizer.eventTimestamp)"] as? SwiftProtobuf.Google_Protobuf_Timestamp {
eventTimeStamp = "\(timestamp.date)"
} else if let nanos = message.asDictionary["storage.eventTimestamp.nanos"] as? Int32,
let seconds = message.asDictionary["storage.eventTimestamp.seconds"] as? Int64 {
let timestamp = SwiftProtobuf.Google_Protobuf_Timestamp(seconds: seconds, nanos: nanos)
eventTimeStamp = "\(timestamp.date)"
}
state = EventsHelper.shared.getState(of: eventGuid)
}
}
Expand Down

0 comments on commit c3361be

Please sign in to comment.