From 9b3a2db7ac917913a0baa54432b6f844437800e8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 12 Oct 2021 09:07:29 -0500 Subject: broadcast options on change --- src/slskd/Application.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 1027d7f3..681384b3 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -638,6 +638,9 @@ namespace slskd Logger.Information("One or more updated options requires an application restart to take effect."); } + PreviousOptions = newOptions; + _ = ApplicationHub.BroadcastOptionsAsync(newOptions); + Logger.Information("Options updated successfully."); } catch (Exception ex) @@ -646,7 +649,6 @@ namespace slskd } finally { - PreviousOptions = OptionsMonitor.CurrentValue; OptionsSyncRoot.ExitWriteLock(); } } @@ -740,7 +742,7 @@ namespace slskd private void State_OnChange((State Previous, State Current) state) { Logger.Debug("State changed from {Previous} to {Current}", state.Previous.ToJson(), state.Current.ToJson()); - ApplicationHub.BroadcastStateAsync(state.Current); + _ = ApplicationHub.BroadcastStateAsync(state.Current); } /// -- cgit v1.2.3