about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/Index.razor
blob: 7e9facf7dcd2b42248278688f04147429a6135ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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>