fix(Toast) Fixing fading.
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
@if (toastService.HasToasts())
|
||||
{
|
||||
<div class="toastsContainer">
|
||||
@foreach( var toast in toastService.GetToasts())
|
||||
@foreach(var toast in Toasts)
|
||||
{
|
||||
|
||||
<ToastComponent Toast="toast"/>
|
||||
}
|
||||
</div>
|
||||
@@ -19,21 +20,38 @@
|
||||
right: 64px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@code {
|
||||
private List<ToastModel> Toasts => toastService.GetToasts();
|
||||
|
||||
private Timer ageTimer = null!;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
toastService.Subscribe(OnUpdate);
|
||||
|
||||
ageTimer = new Timer(10);
|
||||
ageTimer.Elapsed += OnAge!;
|
||||
ageTimer.Enabled = true;
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
toastService.Unsubscribe(OnUpdate);
|
||||
}
|
||||
|
||||
|
||||
void OnAge(object? sender, ElapsedEventArgs elapsedEventArgs)
|
||||
{
|
||||
toastService.AgeToasts();
|
||||
ageTimer.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
void OnUpdate()
|
||||
{
|
||||
|
||||
@@ -6,11 +6,6 @@ using Services.Development;
|
||||
using Services.Immortal;
|
||||
using Services.Website;
|
||||
|
||||
#if NO_SQL
|
||||
#else
|
||||
using Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
|
||||
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
@using IGP.Pages.RoadMap.Parts
|
||||
@using IGP.Pages.Notes
|
||||
@using IGP.Pages.Notes.Parts
|
||||
@using System.Timers
|
||||
@using IGP.Portals
|
||||
@using Markdig
|
||||
@using Model.Feedback
|
||||
|
||||
Reference in New Issue
Block a user