@page "/User/DMSpace/Setup"
@using LibMatrix.Homeservers
@using LibMatrix
@using MatrixUtils.LibDMSpace
@using MatrixUtils.LibDMSpace.StateEvents
@using MatrixUtils.Web.Pages.User.DMSpaceStages
DM Space Management
@switch (Stage) {
case -1:
Initialising...
break;
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
Stage is unknown value: @Stage!
break;
}
@code {
private int _stage = -1;
[Parameter, SupplyParameterFromQuery(Name = "stage")]
public int Stage {
get => _stage;
set {
_stage = value;
Console.WriteLine($"Stage is now {value}");
StateHasChanged();
}
}
public AuthenticatedHomeserverGeneric? Homeserver { get; set; }
public DMSpaceConfiguration? DmSpaceConfiguration { get; set; }
[Parameter]
public DMSpace? DmSpace { get; set; }
protected override async Task OnInitializedAsync() {
if (NavigationManager.Uri.Contains("?stage=")) {
NavigationManager.NavigateTo("/User/DMSpace", true);
}
DmSpace = this;
Homeserver ??= await RMUStorage.GetCurrentSessionOrNavigate();
if (Homeserver is null) return;
try {
DmSpaceConfiguration = await Homeserver.GetAccountDataAsync("gay.rory.dm_space");
var room = Homeserver.GetRoom(DmSpaceConfiguration.DMSpaceId);
await room.GetStateAsync