1 files changed, 0 insertions, 86 deletions
diff --git a/MatrixRoomUtils.Web/Pages/User/DMSpace.razor b/MatrixRoomUtils.Web/Pages/User/DMSpace.razor
deleted file mode 100644
index 21cc264..0000000
--- a/MatrixRoomUtils.Web/Pages/User/DMSpace.razor
+++ /dev/null
@@ -1,86 +0,0 @@
-@page "/User/DMSpace/Setup"
-@using LibMatrix.Homeservers
-@using LibMatrix
-@using MatrixRoomUtils.LibDMSpace
-@using MatrixRoomUtils.LibDMSpace.StateEvents
-@using MatrixRoomUtils.Web.Pages.User.DMSpaceStages
-<h3>DM Space Management</h3>
-<hr/>
-<CascadingValue Value="@DmSpace">
- @switch (Stage) {
- case -1:
- <p>Initialising...</p>
- break;
- case 0:
- <DMSpaceStage0/>
- break;
- case 1:
- <DMSpaceStage1/>
- break;
- case 2:
- <DMSpaceStage2/>
- break;
- case 3:
- <DMSpaceStage3/>
- break;
- default:
- <p>Stage is unknown value: @Stage!</p>
- break;
- }
-</CascadingValue>
-
-@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 MRUStorage.GetCurrentSessionOrNavigate();
- if (Homeserver is null) return;
- try {
- DmSpaceConfiguration = await Homeserver.GetAccountDataAsync<DMSpaceConfiguration>("gay.rory.dm_space");
- var room = Homeserver.GetRoom(DmSpaceConfiguration.DMSpaceId);
- await room.GetStateAsync<object>(DMSpaceInfo.EventId);
- Stage = 1;
- }
- catch (MatrixException e) {
- if (e.ErrorCode == "M_NOT_FOUND") {
- Stage = 0;
- DmSpaceConfiguration = new();
- }
- else throw;
- }
- catch (Exception e) {
- throw;
- }
- finally {
- StateHasChanged();
- }
- await base.OnInitializedAsync();
- }
-
- protected override async Task OnParametersSetAsync() {
- StateHasChanged();
- await base.OnParametersSetAsync();
- }
-
-}
\ No newline at end of file
|