|
@@ -42,9 +42,17 @@ const IncidentPage = () => {
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
- if (isSubscribed) {
|
|
|
|
|
- setIncident(res.data);
|
|
|
|
|
|
|
+ if (!isSubscribed) {
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ let incident = res.data;
|
|
|
|
|
+
|
|
|
|
|
+ incident.events = convertEventsTimestampsToMilliseconds(
|
|
|
|
|
+ incident.events
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ setIncident(incident);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
return () => {
|
|
return () => {
|
|
@@ -140,6 +148,16 @@ const IncidentPage = () => {
|
|
|
|
|
|
|
|
export default IncidentPage;
|
|
export default IncidentPage;
|
|
|
|
|
|
|
|
|
|
+const convertEventsTimestampsToMilliseconds = (events: IncidentEvent[]) => {
|
|
|
|
|
+ return events.map((e) => {
|
|
|
|
|
+ let newEvent = e;
|
|
|
|
|
+
|
|
|
|
|
+ newEvent.timestamp = newEvent.timestamp * 1000;
|
|
|
|
|
+
|
|
|
|
|
+ return newEvent;
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const groupEventsByDate = (
|
|
const groupEventsByDate = (
|
|
|
events: IncidentEvent[]
|
|
events: IncidentEvent[]
|
|
|
): { [key: string]: IncidentEvent[] } => {
|
|
): { [key: string]: IncidentEvent[] } => {
|