about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/DevOptions.razor
blob: bf499a31ed5ed08fd4d922a4353983fef39b8b7f (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
@page "/DevOptions"
@using LibMatrix.Extensions
@inject NavigationManager NavigationManager
@inject ILocalStorageService LocalStorage

<PageTitle>Developer options</PageTitle>

<h3>Rory&::MatrixUtils - Developer options</h3>
<hr/>

<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnableLogViewers" @oninput="@LogStuff"></InputCheckbox><label> Enable log views</label><br/>
<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnableConsoleLogging" @oninput="@LogStuff"></InputCheckbox><label> Enable console logging</label><br/>
<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnablePortableDevtools" @oninput="@LogStuff"></InputCheckbox><label> Enable portable devtools</label><br/>
<br/>

@code {

    MRUStorageWrapper.Settings settings { get; set; } = new();
    protected override async Task OnInitializedAsync() {
        settings = await TieredStorage.DataStorageProvider.LoadObjectAsync<MRUStorageWrapper.Settings>("mru.settings");
        await base.OnInitializedAsync();
    }

    private async Task LogStuff() {
        await Task.Delay(100);
        Console.WriteLine($"Settings: {settings.ToJson()}");
        await TieredStorage.DataStorageProvider.SaveObjectAsync("mru.settings", settings);
    }

}