Buildversion and FilterHelper
This commit is contained in:
@@ -12,9 +12,6 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
/// </summary>
|
||||
public partial class NavMenu
|
||||
{
|
||||
[Inject]
|
||||
private IJSRuntime JsRuntime { get; set; } = null!;
|
||||
|
||||
#region Dependencies
|
||||
|
||||
[Inject]
|
||||
@@ -23,6 +20,12 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
[Inject]
|
||||
protected AuthService AuthService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IWebHostEnvironment Env { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JsRuntime { get; set; } = null!;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
@@ -32,6 +35,8 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
/// </summary>
|
||||
private User CurrentUser => AuthService.User ?? new User();
|
||||
|
||||
private string? Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Properties
|
||||
@@ -50,14 +55,22 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await AuthService.Initialize();
|
||||
|
||||
var filePath = Path.Combine(Env.WebRootPath, "buildinfo.txt");
|
||||
if (File.Exists(filePath)) Version = await File.ReadAllTextAsync(filePath);
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method NavLinkClickedAsync
|
||||
|
||||
private async Task NavLinkClickedAsync()
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('menu-toggler').checked=false;");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user