File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/Nullinside.Api.Common/Twitch Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ public class TwitchClientProxy : ITwitchClientProxy {
7373 /// </summary>
7474 private WebSocketClient ? socket ;
7575
76+ private string ? _twitchOAuthToken ;
77+
7678 /// <summary>
7779 /// Initializes a new instance of the <see cref="TwitchClientProxy" /> class.
7880 /// </summary>
@@ -103,7 +105,18 @@ public static TwitchClientProxy Instance {
103105 public string ? TwitchUsername { get ; set ; }
104106
105107 /// <inheritdoc />
106- public string ? TwitchOAuthToken { get ; set ; }
108+ public string ? TwitchOAuthToken {
109+ get => _twitchOAuthToken ;
110+ set {
111+ _twitchOAuthToken = value ;
112+
113+ // If we have a client, try to connect.
114+ if ( null != client ) {
115+ client . SetConnectionCredentials ( new ConnectionCredentials ( TwitchUsername , value ) ) ;
116+ Connect ( ) ;
117+ }
118+ }
119+ }
107120
108121 /// <inheritdoc />
109122 public void Dispose ( ) {
You can’t perform that action at this time.
0 commit comments