UI fix some crashes in replay

This commit is contained in:
nick-delirium 2024-10-04 11:44:42 +02:00
parent 17057fb6a1
commit 506a944403
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
3 changed files with 12 additions and 2 deletions

View file

@ -17,7 +17,9 @@ function LiveSession({
const { integrationsStore, sessionStore } = useStore();
const session = sessionStore.current;
const fetchFailed = sessionStore.fetchFailed;
const clearCurrentSession = sessionStore.clearCurrentSession;
const fetchSlackList = integrationsStore.slack.fetchIntegrations;
const fetchSession = sessionStore.fetchSessionData;
const [initialLoading, setInitialLoading] = React.useState(true);
usePageTitle('OpenReplay Assist');
@ -32,7 +34,7 @@ function LiveSession({
useEffect(() => {
if (sessionId != null) {
fetchSession(sessionId, true);
void fetchSession(sessionId, true);
} else {
console.error('No sessionID in route.');
}

View file

@ -60,7 +60,7 @@ function EventGroupWrapper(props) {
event={event}
onClick={onEventClick}
selected={isSelected}
showLoadInfo={showLoadInfo}
showLoadInfo
isCurrent={isCurrent}
presentInSearch={presentInSearch}
isLastInGroup={isLastInGroup}

View file

@ -12,6 +12,14 @@ function EventsList({ scale }: { scale: number }) {
return Object.values(tabStates)[0]?.eventList.filter(e => e.time) || [];
}, [eventCount]);
React.useEffect(() => {
const hasDuplicates = events.some((e, i) => {
return events.findIndex((el) => el.key === e.key && el.time === e.time) !== i;
})
if (hasDuplicates) {
console.error('Duplicate events detected in list', events);
}
}, [eventCount])
return (
<>
{events.map((e) => (