about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/Dev/DevOptions.razor
blob: 9b0f61c23e8d21843bad0ed3cfb85d5661187eb1 (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 "/Dev/Options"
@using ArcaneLibs.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);
    }

}