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

<PageTitle>Developer options</PageTitle>

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

<InputCheckbox @bind-Value="@LocalStorageWrapper.Settings.DeveloperSettings.EnableLogViewers" @oninput="@LogStuff"></InputCheckbox><label> Enable log views</label>


@code {
    protected override async Task OnInitializedAsync()
    {
        await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage);
        await base.OnInitializedAsync();
        await LocalStorageWrapper.SaveToLocalStorage(LocalStorage);
    }

    protected async Task LogStuff()
    {
        await Task.Delay(100);
        Console.WriteLine($"Settings: {LocalStorageWrapper.Settings.ToJson()}");
        
        await LocalStorageWrapper.SaveToLocalStorage(LocalStorage);
    }

}