about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/Index.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-01 02:43:32 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-01 02:43:32 +0200
commitdf9031c47f8e97d8e2df3177093271a458f27267 (patch)
tree4e81dec4048c6e76a928ef69c905560d7c173fdf /MatrixRoomUtils.Web/Pages/Index.razor
downloadMatrixUtils-df9031c47f8e97d8e2df3177093271a458f27267.tar.xz
Initial commit
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/Index.razor')
-rw-r--r--MatrixRoomUtils.Web/Pages/Index.razor33
1 files changed, 33 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Index.razor b/MatrixRoomUtils.Web/Pages/Index.razor
new file mode 100644
index 0000000..7e9facf
--- /dev/null
+++ b/MatrixRoomUtils.Web/Pages/Index.razor
@@ -0,0 +1,33 @@
+@page "/"
+@using MatrixRoomUtils.Web.Classes
+@using MatrixRoomUtils.Web.Shared.IndexComponents
+@using Blazored.LocalStorage
+@inject NavigationManager NavigationManager
+@inject ILocalStorageService LocalStorage
+
+<PageTitle>Index</PageTitle>
+
+<h1>Rory&::MatrixUtils</h1>
+Small collection of tools to do not-so-everyday things.
+
+<br/><br/>
+<h5>Signed in accounts - <a href="/Login">Add new account</a> or <a href="/ImportUsers">Import from TSV</a></h5>
+<hr/>
+@{
+    Console.WriteLine("Users in cache: " + RuntimeStorage.UsersCache.Count);
+    if (!RuntimeStorage.WasLoaded)
+    {
+        Console.WriteLine("[INDEX] !!! LOCALSTORAGE WAS NOT LOADED !!!");
+        RuntimeStorage.LoadFromLocalStorage(LocalStorage).GetAwaiter().OnCompleted(() =>
+        {
+            Console.WriteLine("Users in cache: " + RuntimeStorage.UsersCache.Count);
+            StateHasChanged();
+        });
+    }
+}
+<form>
+    @foreach (var (token, user) in RuntimeStorage.UsersCache)
+    {
+        <IndexUserItem User="@user" Token="@token"/>
+    }
+</form>
\ No newline at end of file