about summary refs log tree commit diff
path: root/MatrixUtils.Web/Shared/TimelineComponents
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-03-22 17:47:29 +0100
committerRory& <root@rory.gay>2024-03-22 17:47:29 +0100
commitc69e5c790b2b277d9b11265b8f0883e9f90fe3b9 (patch)
treea2ad72230772d7459605ebc4ba13337e70d3bda4 /MatrixUtils.Web/Shared/TimelineComponents
parentChanges (diff)
downloadMatrixUtils-c69e5c790b2b277d9b11265b8f0883e9f90fe3b9.tar.xz
Changes
Diffstat (limited to 'MatrixUtils.Web/Shared/TimelineComponents')
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor4
-rw-r--r--MatrixUtils.Web/Shared/TimelineComponents/TimelineUnknownStateItem.razor16
2 files changed, 18 insertions, 2 deletions
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
index c7bfd51..08aeffe 100644
--- a/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
+++ b/MatrixUtils.Web/Shared/TimelineComponents/BaseTimelineItem.razor
@@ -14,9 +14,9 @@
     [Parameter]
     public AuthenticatedHomeserverGeneric Homeserver { get; set; }
 
-    public List<StateEventResponse> EventsBefore => Events.TakeWhile(e => e.EventId != Event.EventId).ToList();
+    public IEnumerable<StateEventResponse> EventsBefore => Events.TakeWhile(e => e.EventId != Event.EventId);
 
-    public List<StateEventResponse> MatchingEventsBefore => EventsBefore.Where(x => x.Type == Event.Type && x.StateKey == Event.StateKey).ToList();
+    public IEnumerable<StateEventResponse> MatchingEventsBefore => EventsBefore.Where(x => x.Type == Event.Type && x.StateKey == Event.StateKey);
 
     public StateEventResponse? PreviousState => MatchingEventsBefore.LastOrDefault();
 
diff --git a/MatrixUtils.Web/Shared/TimelineComponents/TimelineUnknownStateItem.razor b/MatrixUtils.Web/Shared/TimelineComponents/TimelineUnknownStateItem.razor
new file mode 100644
index 0000000..4f05b30
--- /dev/null
+++ b/MatrixUtils.Web/Shared/TimelineComponents/TimelineUnknownStateItem.razor
@@ -0,0 +1,16 @@
+@using ArcaneLibs.Extensions
+@inherits BaseTimelineItem
+
+<div>
+    <details style="display: inline;">
+        <summary>
+            <i style="color: red;">Unknown event type: <pre style="display: inline;">@Event.Type</pre></i>
+        </summary>
+        <pre>@Event.ToJson(ignoreNull: true)</pre>
+    </details>
+</div>
+
+@code {
+
+
+}