From ddd72a878ee0992687159d5ee0023c29e551acc6 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Sat, 2 May 2026 21:20:16 +0200 Subject: [PATCH] refactor(emotes): drop async void on LoadData async void Task.Run() is a no-op for awaiting purposes since the void returns immediately. Switch LoadData to async Task and have the two callers fire-and-forget the task directly. Exceptions still go through the existing try/catch inside LoadData. --- ChatTwo/EmoteCache.cs | 2 +- ChatTwo/Plugin.cs | 2 +- ChatTwo/Ui/Settings.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChatTwo/EmoteCache.cs b/ChatTwo/EmoteCache.cs index 366220d..a2c58bf 100644 --- a/ChatTwo/EmoteCache.cs +++ b/ChatTwo/EmoteCache.cs @@ -66,7 +66,7 @@ public static class EmoteCache public static string[] SortedCodeArray = []; - public static async void LoadData() + public static async Task LoadData() { if (State is not LoadingState.Unloaded) return; diff --git a/ChatTwo/Plugin.cs b/ChatTwo/Plugin.cs index fc45fc1..9709d0a 100755 --- a/ChatTwo/Plugin.cs +++ b/ChatTwo/Plugin.cs @@ -241,7 +241,7 @@ public sealed class Plugin : IDalamudPlugin Interface.UiBuilder.OpenMainUi += OpenMainUi; if (Config.ShowEmotes) - Task.Run(EmoteCache.LoadData); + _ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside #if !DEBUG // Avoid 300ms hitch when sending first message by preloading the diff --git a/ChatTwo/Ui/Settings.cs b/ChatTwo/Ui/Settings.cs index cd7ddc7..41b70c9 100755 --- a/ChatTwo/Ui/Settings.cs +++ b/ChatTwo/Ui/Settings.cs @@ -177,7 +177,7 @@ public sealed class SettingsWindow : Dalamud.Interface.Windowing.Window GameFunctions.GameFunctions.SetChatInteractable(true); if (Plugin.Config.ShowEmotes) - Task.Run(EmoteCache.LoadData); + _ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside Initialise(); }