[frontend] Code cleanup
This commit is contained in:
parent
642d4d9332
commit
79a4ce012c
4 changed files with 11 additions and 19 deletions
|
@ -3,7 +3,6 @@
|
|||
@using Iceshrimp.Frontend.Localization
|
||||
@using Iceshrimp.Shared.Schemas.Web
|
||||
@using Microsoft.Extensions.Localization
|
||||
@using _Imports = Iceshrimp.Frontend._Imports
|
||||
@inject IStringLocalizer<Localization> Loc;
|
||||
@inject IJSRuntime Js;
|
||||
@inject SessionService Session;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
using Iceshrimp.Frontend.Core.Services;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Iceshrimp.Frontend.Core.InMemoryLogger;
|
||||
|
@ -15,5 +14,5 @@ internal class InMemoryLogger (IOptions<InMemoryLoggerConfiguration> config, InM
|
|||
return config.Value.LogLevel.HasFlag(logLevel);
|
||||
}
|
||||
|
||||
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => default!;
|
||||
public IDisposable BeginScope<TState>(TState state) where TState : notnull => default!;
|
||||
}
|
|
@ -6,11 +6,9 @@
|
|||
@using Iceshrimp.Shared.Schemas.Web
|
||||
@using Microsoft.Extensions.Localization
|
||||
@using Iceshrimp.Assets.PhosphorIcons
|
||||
@using Microsoft.Extensions.Logging
|
||||
@using Microsoft.AspNetCore.Components.Sections
|
||||
@layout SettingsLayout
|
||||
@inject ApiService Api;
|
||||
@inject ILogger<Filters> Logger;
|
||||
@inject IStringLocalizer<Localization> Loc;
|
||||
|
||||
<SectionContent SectionName="top-bar">
|
||||
|
@ -177,17 +175,17 @@
|
|||
private State State { get; set; } = State.Loading;
|
||||
private string FilterName { get; set; } = "";
|
||||
private string Keyword { get; set; } = "";
|
||||
private List<String> FilterKeywords { get; set; } = [];
|
||||
private List<String> FilterKeywords { get; } = [];
|
||||
private DateTime? FilterExpiry { get; set; }
|
||||
private FilterResponse.FilterAction FilterAction { get; set; }
|
||||
private Menu MenuFilterAction { get; set; } = null!;
|
||||
private Menu MenuFilterContexts { get; set; } = null!;
|
||||
private List<FilterResponse.FilterContext> FilterContexts { get; set; } = [];
|
||||
private List<FilterResponse.FilterContext> FilterContexts { get; } = [];
|
||||
private StateButton ButtonAddFilter { get; set; } = null!;
|
||||
private bool _filterNameInvalid = false;
|
||||
private bool _filterKeywordsInvalid = false;
|
||||
private bool _filterExpiryInvalid = false;
|
||||
private bool _filterContextsInvalid = false;
|
||||
private bool _filterNameInvalid;
|
||||
private bool _filterKeywordsInvalid;
|
||||
private bool _filterExpiryInvalid;
|
||||
private bool _filterContextsInvalid;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
@ -206,17 +204,13 @@
|
|||
{
|
||||
try
|
||||
{
|
||||
var res = await Api.Filters.DeleteFilter(id);
|
||||
if (res == true)
|
||||
if (await Api.Filters.DeleteFilter(id))
|
||||
{
|
||||
var index = FilterList.FindIndex(p => p.Id == id);
|
||||
FilterList.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
catch (ApiException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (ApiException) { }
|
||||
}
|
||||
|
||||
private async Task TryAddFilter()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@using Iceshrimp.Assets.PhosphorIcons
|
||||
@using Iceshrimp.Frontend.Localization
|
||||
@using Microsoft.Extensions.Localization
|
||||
@inject NavigationManager Nav;
|
||||
@* @inject NavigationManager Nav; *@
|
||||
@inject IStringLocalizer<Localization> Loc;
|
||||
|
||||
<SectionContent SectionName="top-bar">
|
||||
|
|
Loading…
Add table
Reference in a new issue