about summary refs log tree commit diff
path: root/MatrixUtils.Web/Shared/TimelineComponents
diff options
context:
space:
mode:
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 {
+
+
+}