Skip to content

Commit ce0ad39

Browse files
Merge pull request #86 from nullinside-development-group/fix/design
fix: design view connecting to tts
2 parents 9d8e045 + 7ca5501 commit ce0ad39

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/TwitchStreamingTools/Configuration.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using System.Linq;
55
using System.Speech.Synthesis;
66

7+
using Avalonia.Controls;
8+
79
using Newtonsoft.Json;
810

911
using Nullinside.Api.Common.Twitch;
@@ -91,6 +93,10 @@ public static Configuration Instance {
9193
/// </summary>
9294
/// <returns>True if successful, false otherwise.</returns>
9395
public bool WriteConfiguration() {
96+
if (Design.IsDesignMode) {
97+
return false;
98+
}
99+
94100
try {
95101
Directory.CreateDirectory(Path.GetDirectoryName(CONFIG_LOCATION)!);
96102

src/TwitchStreamingTools/Services/TwitchTtsService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Linq;
44
using System.Threading;
55

6+
using Avalonia.Controls;
7+
68
using log4net;
79

810
using Nullinside.Api.Common.Twitch;
@@ -93,6 +95,10 @@ private void Main() {
9395
/// Connects to any configuration found in the config file that we are not currently connected to.
9496
/// </summary>
9597
private void ConnectChatsInConfig() {
98+
if (Design.IsDesignMode) {
99+
return;
100+
}
101+
96102
List<string?>? missing = _configuration.TwitchChats?
97103
.Select(c => c.TwitchChannel)
98104
.Except(_chats?.Select(c => c.ChatConfig?.TwitchChannel) ?? [])

0 commit comments

Comments
 (0)