diff --git a/Wabbajack.App.Blazor/Components/ProgressBar.razor b/Wabbajack.App.Blazor/Components/ProgressBar.razor index 7a161a10..41766e5a 100644 --- a/Wabbajack.App.Blazor/Components/ProgressBar.razor +++ b/Wabbajack.App.Blazor/Components/ProgressBar.razor @@ -15,20 +15,18 @@ [Parameter] public IObservable ProgressObserver { get; set; } - [Parameter] public string Text { get; set; } + [Parameter] public string? Text { get; set; } - protected override Task OnInitializedAsync() + protected override void OnInitialized() { var textPercentage = string.IsNullOrEmpty(Text); ProgressObserver .Sample(TimeSpan.FromMilliseconds(250)) - .DistinctUntilChanged() + .DistinctUntilChanged(p => p.Value) .Subscribe(p => { CurrentProgress = p.Value; if (textPercentage) Text = p.ToString(); InvokeAsync(StateHasChanged); }); - - return base.OnInitializedAsync(); } } diff --git a/Wabbajack.App.Blazor/Components/StepLogger.razor b/Wabbajack.App.Blazor/Components/StepLogger.razor deleted file mode 100644 index 89e47510..00000000 --- a/Wabbajack.App.Blazor/Components/StepLogger.razor +++ /dev/null @@ -1,20 +0,0 @@ -@using Wabbajack.App.Blazor.Pages - -@namespace Wabbajack.App.Blazor.Components - -
- @foreach (var step in value.StatusStep.Take(ShownSteps)) - { -
@step
- } -
- -@code { - [Parameter] - public int ShownSteps { get; set; } - [Parameter] - public bool Reverse { get; set; } - - [CascadingParameter] - public Installing value { get; set; } -} diff --git a/Wabbajack.App.Blazor/Components/StepLogger.razor.scss b/Wabbajack.App.Blazor/Components/StepLogger.razor.scss deleted file mode 100644 index 1f6da37a..00000000 --- a/Wabbajack.App.Blazor/Components/StepLogger.razor.scss +++ /dev/null @@ -1,33 +0,0 @@ -#step-logger { - display: flex; - width: 100%; - height: 100%; - flex-direction: column; - justify-content: center; - align-content: center; - - .step { - &:nth-child(1) { - margin-left: 0.5rem; - font-size: 2rem; - font-weight: 100; - color: rgba(255, 255, 255, 0.9); - } - - &:nth-child(2) { - margin-left: 0.75rem; - font-size: 1.85rem; - font-weight: 100; - color: rgba(255, 255, 255, 0.6); - filter: blur(1px); - } - - &:nth-child(3) { - margin-left: 1rem; - font-size: 1.7rem; - font-weight: 100; - color: rgba(255, 255, 255, 0.4); - filter: blur(1.5px); - } - } -} diff --git a/Wabbajack.App.Blazor/Pages/Gallery.razor.cs b/Wabbajack.App.Blazor/Pages/Gallery.razor.cs index f9095e9a..f443bdab 100644 --- a/Wabbajack.App.Blazor/Pages/Gallery.razor.cs +++ b/Wabbajack.App.Blazor/Pages/Gallery.razor.cs @@ -23,7 +23,7 @@ public partial class Gallery [Inject] private NavigationManager NavigationManager { get; set; } = default!; [Inject] private ModListDownloadMaintainer Maintainer { get; set; } = default!; - [CascadingParameter] public IModalService Modal { get; set; } + [Inject] private IModalService Modal { get; set; } = default!; private IObservable DownloadProgress { get; set; } private ModlistMetadata? DownloadingMetaData { get; set; } @@ -79,6 +79,7 @@ public partial class Gallery var dispose = progress .Sample(TimeSpan.FromMilliseconds(250)) + .DistinctUntilChanged(p => p.Value) .Subscribe(p => { StateContainer.TaskBarState = new TaskBarState { diff --git a/Wabbajack.App.Blazor/Pages/Install/Configure.razor.cs b/Wabbajack.App.Blazor/Pages/Install/Configure.razor.cs index a9ec9984..9fa8b255 100644 --- a/Wabbajack.App.Blazor/Pages/Install/Configure.razor.cs +++ b/Wabbajack.App.Blazor/Pages/Install/Configure.razor.cs @@ -90,7 +90,7 @@ public partial class Configure } } - private async void SelectInstallFolder() + private async Task SelectInstallFolder() { try { @@ -103,7 +103,7 @@ public partial class Configure } } - private async void SelectDownloadFolder() + private async Task SelectDownloadFolder() { try { diff --git a/Wabbajack.App.Blazor/Pages/Install/Installing.razor b/Wabbajack.App.Blazor/Pages/Install/Installing.razor index 921fb124..94528959 100644 --- a/Wabbajack.App.Blazor/Pages/Install/Installing.razor +++ b/Wabbajack.App.Blazor/Pages/Install/Installing.razor @@ -10,17 +10,16 @@ @if (Modlist is not null) {
- - - - + +
+ @foreach (var step in StatusStep.Take(3)) + { +
@step
+ } +
-
-
-
-
} diff --git a/Wabbajack.App.Blazor/Pages/Install/Installing.razor.cs b/Wabbajack.App.Blazor/Pages/Install/Installing.razor.cs index 307fa050..d53727ea 100644 --- a/Wabbajack.App.Blazor/Pages/Install/Installing.razor.cs +++ b/Wabbajack.App.Blazor/Pages/Install/Installing.razor.cs @@ -53,7 +53,7 @@ public partial class Installing _shouldRender = true; } - private async void Install() + private async Task Install() { if (Modlist is null) return; diff --git a/Wabbajack.App.Blazor/Pages/Install/Installing.razor.scss b/Wabbajack.App.Blazor/Pages/Install/Installing.razor.scss index 4b103a87..6385628b 100644 --- a/Wabbajack.App.Blazor/Pages/Install/Installing.razor.scss +++ b/Wabbajack.App.Blazor/Pages/Install/Installing.razor.scss @@ -48,6 +48,40 @@ $checkbox-size: 0.75rem; .left-side, .right-side { flex: 1; margin: 1rem; + + .step-logger { + display: flex; + width: 100%; + height: 100%; + flex-direction: column; + justify-content: center; + align-content: center; + + .step { + &:nth-child(1) { + margin-left: 0.5rem; + font-size: 2rem; + font-weight: 100; + color: rgba(255, 255, 255, 0.9); + } + + &:nth-child(2) { + margin-left: 0.75rem; + font-size: 1.85rem; + font-weight: 100; + color: rgba(255, 255, 255, 0.6); + filter: blur(1px); + } + + &:nth-child(3) { + margin-left: 1rem; + font-size: 1.7rem; + font-weight: 100; + color: rgba(255, 255, 255, 0.4); + filter: blur(1.5px); + } + } + } } } diff --git a/Wabbajack.App.Blazor/wwwroot/index.html b/Wabbajack.App.Blazor/wwwroot/index.html index 30ed985c..cf8beb39 100644 --- a/Wabbajack.App.Blazor/wwwroot/index.html +++ b/Wabbajack.App.Blazor/wwwroot/index.html @@ -36,12 +36,6 @@