From 166621562ed9bb1971a507eedf08269cb0921778 Mon Sep 17 00:00:00 2001 From: "Jeffrey T. Fritz" Date: Sun, 8 Oct 2023 17:51:27 -0400 Subject: [PATCH] Updated twitchchatconfig to have a default (#229) * Updated twitchchatconfig to have a default * Applying formatting changes through GitHub Actions --------- Co-authored-by: github-actions[bot] --- .../StartTwitchChat.cs | 22 +++++++++++-------- .../TwitchChatConfiguration.cs | 10 +++++++++ src/TagzApp.Web/wwwroot/css/site.css | 4 ++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/TagzApp.Providers.TwitchChat/StartTwitchChat.cs b/src/TagzApp.Providers.TwitchChat/StartTwitchChat.cs index db05fb76..febbebb7 100644 --- a/src/TagzApp.Providers.TwitchChat/StartTwitchChat.cs +++ b/src/TagzApp.Providers.TwitchChat/StartTwitchChat.cs @@ -34,16 +34,20 @@ protected override void MapConfigurationValues(ProviderConfiguration providerCon { var config = providerConfiguration.ConfigurationSettings; - if (config != null) + if (config is null) { - _TwitchChatConfiguration = new TwitchChatConfiguration - { - ClientId = config["ClientId"] ?? string.Empty, - ClientSecret = config["ClientSecret"] ?? string.Empty, - ChatBotName = config["ChatBotName"] ?? string.Empty, - OAuthToken = config["OAuthToken"] ?? string.Empty, - ChannelName = config["ChannelName"] ?? string.Empty - }; + _TwitchChatConfiguration = TwitchChatConfiguration.Empty; + return; } + + _TwitchChatConfiguration = new TwitchChatConfiguration + { + ClientId = config.GetValueOrDefault("ClientId", string.Empty), + ClientSecret = config.GetValueOrDefault("ClientSecret", string.Empty), + ChatBotName = config.GetValueOrDefault("ChatBotName", string.Empty), + OAuthToken = config.GetValueOrDefault("OAuthToken", string.Empty), + ChannelName = config.GetValueOrDefault("ChannelName", string.Empty) + }; + } } diff --git a/src/TagzApp.Providers.TwitchChat/TwitchChatConfiguration.cs b/src/TagzApp.Providers.TwitchChat/TwitchChatConfiguration.cs index 580d87ef..b8beec4f 100644 --- a/src/TagzApp.Providers.TwitchChat/TwitchChatConfiguration.cs +++ b/src/TagzApp.Providers.TwitchChat/TwitchChatConfiguration.cs @@ -7,4 +7,14 @@ public class TwitchChatConfiguration public required string ChatBotName { get; set; } public required string OAuthToken { get; set; } public required string ChannelName { get; set; } = "csharpfritz"; + + public static TwitchChatConfiguration Empty => new() + { + ClientId = string.Empty, + ClientSecret = string.Empty, + ChatBotName = string.Empty, + OAuthToken = string.Empty, + ChannelName = string.Empty + }; + } diff --git a/src/TagzApp.Web/wwwroot/css/site.css b/src/TagzApp.Web/wwwroot/css/site.css index 0403c4bd..39c2b5de 100644 --- a/src/TagzApp.Web/wwwroot/css/site.css +++ b/src/TagzApp.Web/wwwroot/css/site.css @@ -326,11 +326,11 @@ span.invisible { width: 50%; text-align: center; font-size: 4em; - color: #777; + color: #333; } #moderationAction i:hover { - color: #333; + color: firebrick; cursor: pointer; }