diff --git a/Reader/Modules/Logging/Log.cs b/Reader/Modules/Logging/Log.cs index 778a59d..bffbb8f 100644 --- a/Reader/Modules/Logging/Log.cs +++ b/Reader/Modules/Logging/Log.cs @@ -95,7 +95,7 @@ private static async Task PostToCentralLog(string messageTemplate, params object using (var httpClient = new HttpClient()) { httpClient.Timeout = TimeSpan.FromSeconds(4); - Task.Run(async () => await httpClient.PostAsync(Constants.CentralLoggerEndpoint, content)); + _ = Task.Run(async () => await httpClient.PostAsync(Constants.CentralLoggerEndpoint, content)); } } catch (Exception e) diff --git a/Reader/Modules/Reading/ReaderConfigManager.cs b/Reader/Modules/Reading/ReaderConfigManager.cs index ba55c69..04d5e27 100644 --- a/Reader/Modules/Reading/ReaderConfigManager.cs +++ b/Reader/Modules/Reading/ReaderConfigManager.cs @@ -124,7 +124,6 @@ public string FrontMiddleCharHighlightingColor public void SaveConfig() { - Console.WriteLine("Saving config"); _ = Task.Run(() => localStorage.SetItemAsStringAsync("readerConfig", JsonConvert.SerializeObject(Config))); } diff --git a/Reader/Modules/Reading/ReaderContext.cs b/Reader/Modules/Reading/ReaderContext.cs index 3037ba9..ecbbf82 100644 --- a/Reader/Modules/Reading/ReaderContext.cs +++ b/Reader/Modules/Reading/ReaderContext.cs @@ -182,15 +182,15 @@ public async Task HandleTitleChanged(string newTitle) public async Task OverwriteState() { - PrepareSelectedStateChanging(); + await PrepareSelectedStateChanging(); await HandleSelectedReaderStateChanged(); } - public void PrepareSelectedStateChanging() + public async Task PrepareSelectedStateChanging() { if (Manager != null) - Manager.StopReadingTask(); + await Manager.StopReadingTask(); } public async Task HandleSelectedReaderStateChanged() diff --git a/Reader/Modules/Reading/ReaderManager.cs b/Reader/Modules/Reading/ReaderManager.cs index a0ebde2..b436894 100644 --- a/Reader/Modules/Reading/ReaderManager.cs +++ b/Reader/Modules/Reading/ReaderManager.cs @@ -50,15 +50,15 @@ public void SetupTextPieces() ClampPosition(); } - public void HandleStartStop() + public async Task HandleStartStop() { if (!ReadingStatus) { - StartReadingTask(); + await StartReadingTask(); } else { - StopReadingTask(); + await StopReadingTask(); } } diff --git a/Reader/Shared/Reading/ReaderView.razor b/Reader/Shared/Reading/ReaderView.razor index eff8570..efe7287 100644 --- a/Reader/Shared/Reading/ReaderView.razor +++ b/Reader/Shared/Reading/ReaderView.razor @@ -194,7 +194,7 @@ if (firstRender) { _hotKeysContext = this.HotKeys.CreateContext(); - _hotKeysContext.Add(ModCode.None, Code.Space, (Action)(async () => { ReaderContext.Manager.HandleStartStop(); await InvokeAsync(() => StateHasChanged()); })); + _hotKeysContext.Add(ModCode.None, Code.Space, (Action)(async () => { await ReaderContext.Manager.HandleStartStop(); await InvokeAsync(() => StateHasChanged()); })); _hotKeysContext.Add(ModCode.None, Code.ArrowLeft, (Action)(async () => { ReaderContext.Manager.HandleNavBefore(); await InvokeAsync(() => StateHasChanged()); })); _hotKeysContext.Add(ModCode.None, Code.ArrowRight, ReaderContext.Manager.HandleNavNext); _hotKeysContext.Add(ModCode.Ctrl, Code.F, (Action)(async () => await ToggleFocusMode()));