Fan website of IMMORTAL: Gates of Pyre.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

68 lines
1.5 KiB

@page "/storage"
@inject IStorageService StorageService
@using Services.Website
@implements IDisposable
@layout PageLayout
<LayoutMediumContentComponent>
@if (!_enabledPermissions)
{
<AlertComponent Type="@SeverityType.Error">
<Title>Storage Disabled</Title>
<Message>Enable Storage on the Permissions Page.</Message>
</AlertComponent>
}
else
{
<PaperComponent>
<FormLayoutComponent>
<FormToggleComponent
Label="Is Plain View"
Value="@_isEntityPlainView"
OnChange="EntityViewChanged"/>
</FormLayoutComponent>
</PaperComponent>
}
<ContentDividerComponent/>
<PaperComponent>
</PaperComponent>
</LayoutMediumContentComponent>
@code {
bool _enabledPermissions;
protected override void OnInitialized()
{
_enabledPermissions = StorageService.GetValue<bool>(StorageKeys.EnabledStorage);
Update();
StorageService.Subscribe(Update);
}
public void Dispose()
{
StorageService.Unsubscribe(Update);
}
void Update()
{
_isEntityPlainView = StorageService.GetValue<bool>(StorageKeys.IsPlainView);
StateHasChanged();
}
private bool _isEntityPlainView;
private void EntityViewChanged(ChangeEventArgs obj)
{
StorageService.SetValue(StorageKeys.IsPlainView, obj.Value);
}
}