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 {
73
73
/// </summary>
74
74
private WebSocketClient ? socket ;
75
75
76
+ private string ? _twitchOAuthToken ;
77
+
76
78
/// <summary>
77
79
/// Initializes a new instance of the <see cref="TwitchClientProxy" /> class.
78
80
/// </summary>
@@ -103,7 +105,18 @@ public static TwitchClientProxy Instance {
103
105
public string ? TwitchUsername { get ; set ; }
104
106
105
107
/// <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
+ }
107
120
108
121
/// <inheritdoc />
109
122
public void Dispose ( ) {
You can’t perform that action at this time.
0 commit comments