diff --git a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientRoomList.razor b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientRoomList.razor
index b370080..8831dd1 100644
--- a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientRoomList.razor
+++ b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientRoomList.razor
@@ -10,6 +10,6 @@
@code {
[Parameter]
- public ClientContext Data { get; set; } = null!;
+ public ClientContext Data { get; set; }
}
\ No newline at end of file
diff --git a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientStatusList.razor b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientStatusList.razor
index c680c13..60f850d 100644
--- a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientStatusList.razor
+++ b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/ClientStatusList.razor
@@ -10,7 +10,7 @@
@code {
[Parameter]
- public ObservableCollection<ClientContext> Data { get; set; } = null!;
+ public ObservableCollection<ClientContext> Data { get; set; }
protected override void OnInitialized() {
Data.CollectionChanged += (_, e) => {
diff --git a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/MatrixClient.razor b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/MatrixClient.razor
index 67dcae5..6a930b1 100644
--- a/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/MatrixClient.razor
+++ b/MatrixUtils.Web/Pages/Labs/Client/ClientComponents/MatrixClient.razor
@@ -25,6 +25,6 @@
@code {
[Parameter]
- public Index.ClientContext Data { get; set; } = null!;
+ public Index.ClientContext Data { get; set; }
}
\ No newline at end of file
diff --git a/MatrixUtils.Web/Pages/Labs/Client/Index.razor b/MatrixUtils.Web/Pages/Labs/Client/Index.razor
index ef4a0b9..c6e7d1a 100644
--- a/MatrixUtils.Web/Pages/Labs/Client/Index.razor
+++ b/MatrixUtils.Web/Pages/Labs/Client/Index.razor
@@ -40,11 +40,11 @@
}
protected override async Task OnInitializedAsync() {
- var tokens = await RMUStorage.GetAllTokens();
- var tasks = tokens.Select(async token => {
+ var tokens = await sessionStore.GetAllSessions();
+ var tasks = tokens.Keys.Select(async token => {
try {
var cc = new ClientContext() {
- Homeserver = await RMUStorage.GetSession(token)
+ Homeserver = await sessionStore.GetHomeserver(token)
};
cc.SyncWrapper = new ClientSyncWrapper(cc.Homeserver);
diff --git a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpace.razor b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpace.razor
index c0dc8a6..f81afe5 100644
--- a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpace.razor
+++ b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpace.razor
@@ -52,7 +52,7 @@
NavigationManager.NavigateTo(NavigationManager.Uri.Replace("stage=", ""), true); //"/User/DMSpace/Setup"
}
DMSpaceRootPage = this;
- SetupData.Homeserver ??= await RMUStorage.GetCurrentSessionOrNavigate();
+ SetupData.Homeserver ??= await sessionStore.GetCurrentHomeserver(navigateOnFailure: true);
if (SetupData.Homeserver is null) return;
try {
SetupData.DmSpaceConfiguration = await SetupData.Homeserver.GetAccountDataAsync<DMSpaceConfiguration>("gay.rory.dm_space");
diff --git a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage1.razor b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage1.razor
index 55e17d6..a974a8f 100644
--- a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage1.razor
+++ b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage1.razor
@@ -4,7 +4,8 @@
@using MatrixUtils.LibDMSpace
@using MatrixUtils.LibDMSpace.StateEvents
@using ArcaneLibs.Extensions
-@using LibMatrix.EventTypes.Spec.State
+@using LibMatrix.EventTypes.Spec.State.RoomInfo
+@using LibMatrix.EventTypes.Spec.State.Space
@using MatrixUtils.Abstractions
<b>
<u>DM Space setup tool - stage 1: Configure space</u>
diff --git a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage2.razor b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage2.razor
index be6027a..b8eb257 100644
--- a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage2.razor
+++ b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage2.razor
@@ -1,6 +1,6 @@
@using LibMatrix.RoomTypes
-@using LibMatrix.EventTypes.Spec.State
@using ArcaneLibs.Extensions
+@using LibMatrix.EventTypes.Spec.State.RoomInfo
@using MatrixUtils.Abstractions
<b>
<u>DM Space setup tool - stage 2: Fix DM room attribution</u>
diff --git a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage3.razor b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage3.razor
index 09de5d3..dac9c49 100644
--- a/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage3.razor
+++ b/MatrixUtils.Web/Pages/Labs/DMSpace/DMSpaceStages/DMSpaceStage3.razor
@@ -1,8 +1,8 @@
@using LibMatrix.RoomTypes
-@using LibMatrix.EventTypes.Spec.State
@using LibMatrix.Responses
@using MatrixUtils.LibDMSpace
@using System.Text.Json.Serialization
+@using LibMatrix.EventTypes.Spec.State.RoomInfo
@using MatrixUtils.Abstractions
<b>
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2.razor
index 3392960..441752b 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2.razor
@@ -55,7 +55,7 @@
public RoomListViewData Data { get; set; } = new RoomListViewData();
protected override async Task OnInitializedAsync() {
- Data.Homeserver = await RMUStorage.GetCurrentSessionOrNavigate();
+ Data.Homeserver = await sessionStore.GetCurrentHomeserver(navigateOnFailure: true);
if (Data.Homeserver is null) return;
var rooms = await Data.Homeserver.GetJoinedRooms();
Data.GlobalProfile = await Data.Homeserver.GetProfileAsync(Data.Homeserver.WhoAmI.UserId);
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/MainTabComponents/MainTabSpaceItem.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/MainTabComponents/MainTabSpaceItem.razor
index 6483f01..ba994d1 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/MainTabComponents/MainTabSpaceItem.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/MainTabComponents/MainTabSpaceItem.razor
@@ -1,14 +1,14 @@
@using MatrixUtils.Abstractions
-<div class="spaceListItem" style="@(SelectedSpace == Space ? "background-color: #FFFFFF33;" : "")" onclick="@SelectSpace">
+<div class="spaceListItem" style="@(SelectedSpace == Space ? "background-color: #FFFFFF33;" : "")" @onclick="@SelectSpace">
<div class="spaceListItemContainer">
@if (IsSpaceOpened()) {
- <span onclick="@ToggleSpace">▼ </span>
+ <span @onclick="@ToggleSpace">▼ </span>
}
else {
- <span onclick="@ToggleSpace">▶ </span>
+ <span @onclick="@ToggleSpace">▶ </span>
}
- <MxcImage Circular="true" Height="32" Width="32" Homeserver="Space.Room.Homeserver" MxcUri="@Space.RoomIcon"></MxcImage>
+ <MxcImage Homeserver="@Homeserver" Circular="true" Height="32" Width="32" Uri="@Space.RoomIcon"></MxcImage>
<span class="spaceNameEllipsis">@Space.RoomName</span>
</div>
@if (IsSpaceOpened()) {
@@ -30,6 +30,9 @@
[Parameter]
public List<RoomInfo> OpenedSpaces { get; set; }
+ [Parameter]
+ public AuthenticatedHomeserverGeneric Homeserver { get; set; }
+
protected override Task OnInitializedAsync() {
Space.PropertyChanged += (sender, args) => { StateHasChanged(); };
return base.OnInitializedAsync();
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2ByRoomTypeTab.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2ByRoomTypeTab.razor
index f4cf849..79f931b 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2ByRoomTypeTab.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2ByRoomTypeTab.razor
@@ -22,7 +22,7 @@
@code {
[CascadingParameter]
- public Index2.RoomListViewData Data { get; set; } = null!;
+ public Index2.RoomListViewData Data { get; set; }
protected override async Task OnInitializedAsync() {
Data.Rooms.CollectionChanged += (sender, args) => {
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2DMsTab.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2DMsTab.razor
index f4cf849..79f931b 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2DMsTab.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2DMsTab.razor
@@ -22,7 +22,7 @@
@code {
[CascadingParameter]
- public Index2.RoomListViewData Data { get; set; } = null!;
+ public Index2.RoomListViewData Data { get; set; }
protected override async Task OnInitializedAsync() {
Data.Rooms.CollectionChanged += (sender, args) => {
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2MainTab.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2MainTab.razor
index 7ccfae2..99b031a 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2MainTab.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2MainTab.razor
@@ -1,6 +1,6 @@
@using MatrixUtils.Abstractions
@using System.ComponentModel
-@using LibMatrix.EventTypes.Spec.State
+@using LibMatrix.EventTypes.Spec.State.Space
@using MatrixUtils.Web.Pages.Labs.Rooms2.Index2Components.MainTabComponents
<h3>RoomsIndex2MainTab</h3>
@@ -22,31 +22,32 @@
@* </div> *@
@* </div> *@
-<div>
- <div class="row">
- <div class="col-3" style="background-color: #ffffff22;">
- <LinkButton>Uncategorised rooms</LinkButton>
- @foreach (var space in GetTopLevelSpaces()) {
- @* @RecursingSpaceChildren(space) *@
- <MainTabSpaceItem Space="space" OpenedSpaces="OpenedSpaces" @bind-SelectedSpace="SelectedSpace" />
- }
- </div>
- <div class="col-9" style="background-color: #ff00ff66;">
- <p>Placeholder for rooms list...</p>
- @if (SelectedSpace != null) {
- foreach (var room in GetSpaceChildRooms(SelectedSpace)) {
- <p>@room.RoomName</p>
+<CascadingValue Name="Homeserver" Value="@Data.Homeserver">
+ <div>
+ <div class="row">
+ <div class="col-3" style="background-color: #ffffff22;">
+ <LinkButton>Uncategorised rooms</LinkButton>
+ @foreach (var space in GetTopLevelSpaces()) {
+ @* @RecursingSpaceChildren(space) *@
+ <MainTabSpaceItem Space="space" OpenedSpaces="OpenedSpaces" @bind-SelectedSpace="SelectedSpace"/>
+ }
+ </div>
+ <div class="col-9" style="background-color: #ff00ff66;">
+ <p>Placeholder for rooms list...</p>
+ @if (SelectedSpace != null) {
+ foreach (var room in GetSpaceChildRooms(SelectedSpace)) {
+ <p>@room.RoomName</p>
+ }
}
- }
+ </div>
</div>
</div>
-</div>
-
+</CascadingValue>
@code {
[CascadingParameter]
- public Index2.RoomListViewData Data { get; set; } = null!;
+ public Index2.RoomListViewData Data { get; set; }
protected override async Task OnInitializedAsync() {
Data.Rooms.CollectionChanged += (sender, args) => {
@@ -118,7 +119,7 @@
var childSpaces = children.Where(x => x.RoomType == "m.space").ToList();
return childSpaces;
}
-
+
private List<RoomInfo> GetSpaceChildRooms(RoomInfo space) {
var children = GetSpaceChildren(space);
var childRooms = children.Where(x => x.RoomType != "m.space").ToList();
diff --git a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2SyncContainer.razor b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2SyncContainer.razor
index 91f228d..33c310a 100644
--- a/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2SyncContainer.razor
+++ b/MatrixUtils.Web/Pages/Labs/Rooms2/Index2Components/RoomsIndex2SyncContainer.razor
@@ -2,11 +2,11 @@
@using LibMatrix.Responses
@using MatrixUtils.Abstractions
@using System.Diagnostics
-@using LibMatrix.EventTypes.Spec.State
@using LibMatrix.Extensions
@using LibMatrix.Utilities
@using System.Collections.ObjectModel
@using ArcaneLibs
+@using LibMatrix.EventTypes.Spec.State.Space
@inject ILogger<RoomsIndex2SyncContainer> logger
<pre>RoomsIndex2SyncContainer</pre>
@foreach (var (name, value) in _statusList) {
@@ -16,7 +16,7 @@
@code {
[Parameter]
- public Index2.RoomListViewData Data { get; set; } = null!;
+ public Index2.RoomListViewData Data { get; set; }
private SyncHelper syncHelper;
@@ -113,7 +113,7 @@
statusd.Status = $"{roomId} already known with {room.StateEvents?.Count ?? 0} state events";
}
else {
- statusd.Status = $"Eencountered new room {roomId}!";
+ statusd.Status = $"Encountered new room {roomId}!";
room = new RoomInfo(Data.Homeserver!.GetRoom(roomId), roomData.State?.Events);
Data.Rooms.Add(room);
}
|