aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-11-07 08:27:11 -0600
committerJP Dillingham <jp@dillingham.me>2022-11-07 08:27:11 -0600
commit1a5d1cfcbb79c603bd9a79a5a6e05fc5b536ef4d (patch)
treef1b352801bf7b5bdbe67229ab92ec3532c2bf153 /src
parente39c7c192b104c21b6b732ae7c996b257cc7a1f9 (diff)
downloadslskd-1a5d1cfcbb79c603bd9a79a5a6e05fc5b536ef4d.tar.gz
defaults for network state
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/State.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/slskd/Core/State.cs b/src/slskd/Core/State.cs
index c2039522..df670893 100644
--- a/src/slskd/Core/State.cs
+++ b/src/slskd/Core/State.cs
@@ -19,6 +19,7 @@ namespace slskd
{
using System;
using System.Collections.Generic;
+ using System.Linq;
using System.Net;
using System.Text.Json.Serialization;
using slskd.Network;
@@ -67,14 +68,14 @@ namespace slskd
public record NetworkState
{
public OperationMode Mode { get; init; }
- public NetworkControllerState Controller { get; init; }
- public IReadOnlyCollection<Agent> Agents { get; init; }
+ public NetworkControllerState Controller { get; init; } = new NetworkControllerState();
+ public IReadOnlyCollection<Agent> Agents { get; init; } = Enumerable.Empty<Agent>().ToList().AsReadOnly();
}
public record NetworkControllerState
{
public string Address { get; init; }
- public NetworkClientState State { get; init; }
+ public NetworkClientState State { get; init; } = NetworkClientState.Disconnected;
}
public record UserState