Skip to content

Commit

Permalink
Default to [] for auth_events in case they are missing e.g prev_auth_…
Browse files Browse the repository at this point in the history
…events
  • Loading branch information
kegsay committed Dec 20, 2024
1 parent 51104bc commit c786329
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const redraw = (vis: HTMLDivElement, events: MatrixEvent[], opts: RenderOptions)
return (eventsById.get(a)?.streamPosition || 0) - (eventsById.get(b)?.streamPosition || 0);
});
// order auth events reverse chronologically
d.auth_events = d.auth_events.sort((a: string, b: string) => {
d.auth_events = (d.auth_events || []).sort((a: string, b: string) => {
return (eventsById.get(b)?.streamPosition || 0) - (eventsById.get(a)?.streamPosition || 0);
});
// remove auth events that point to create events, as they are very duplicative.
Expand Down

0 comments on commit c786329

Please sign in to comment.