diff --git a/frontend/app/components/Session_/EventsBlock/EventGroupWrapper.tsx b/frontend/app/components/Session_/EventsBlock/EventGroupWrapper.tsx
index 6df5889f1..10a404c6e 100644
--- a/frontend/app/components/Session_/EventsBlock/EventGroupWrapper.tsx
+++ b/frontend/app/components/Session_/EventsBlock/EventGroupWrapper.tsx
@@ -190,7 +190,7 @@ function TabChange({ from, to, activeUrl, onClick }) {
);
};
-function Incident({ label, onClick, isCurrent }: { label: string; onClick: () => void; isCurrent?: boolean }) {
+function Incident({ label, onClick }: { label: string; onClick: () => void }) {
const { t } = useTranslation();
return (
{
- if (!usedEvents.length) return 0;
- let i = usedEvents.length - 1;
+ const allEvents = usedEvents.concat(incidents);
+ if (!allEvents.length) return 0;
+ let i = allEvents.length - 1;
if (time > endTime / 2) {
- while (i >= 0) {
- const event = usedEvents[i];
+ while (i > 0) {
+ const event = allEvents[i];
if ('time' in event && event.time <= time) break;
i--;
}
@@ -135,18 +135,18 @@ function EventsBlock(props: IProps) {
}
let l = 0;
while (l < i) {
- const event = usedEvents[l];
+ const event = allEvents[l];
if ('time' in event && event.time >= time) break;
l++;
}
return l;
},
- [usedEvents, time, endTime],
+ [usedEvents, incidents, time, endTime],
);
useEffect(() => {
setCurrentTimeEventIndex(findLastFitting(time));
- }, []);
+ }, [time]);
const write = ({
target: { value },
diff --git a/frontend/app/types/session/session.ts b/frontend/app/types/session/session.ts
index 8a5b798de..8c0b90d7e 100644
--- a/frontend/app/types/session/session.ts
+++ b/frontend/app/types/session/session.ts
@@ -452,7 +452,6 @@ export default class Session {
userTestingEvents: any[] = [],
incidents: any[] = [],
) {
- console.log('ADD EVENTS', errors, issues, sessionEvents, incidents);
const exceptions =
(errors as IError[])?.map((e) => new SessionError(e)) || [];
const issuesList =
@@ -523,12 +522,10 @@ export default class Session {
);
this.events = events;
- console.log('notesWithEvents 0', this.notesWithEvents, mixedEventsWithIssues);
// @ts-ignore
this.notesWithEvents = [
...this.notesWithEvents,
...mixedEventsWithIssues,
- ...incidentsList,
].sort(sortEvents);
this.errors = exceptions;
this.issues = issuesList;
@@ -538,7 +535,6 @@ export default class Session {
this.crashes = crashes || [];
this.addedEvents = true;
this.incidents = incidentsList;
- console.log('notesWithEvents', this.notesWithEvents, mixedEventsWithIssues);
return this;
}