fixed subchannel not being recognized

This commit is contained in:
2025-01-24 01:54:55 +01:00
parent 23a8a6464d
commit 798dfd8ec5
4 changed files with 60 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ export class TS5ConnectionHandler implements ITS5ConnectionHandler {
this.logger.log('Connecting to TS5 client...');
// Create authentication payload
const initalPayload: IAuthSenderPayload = {
const initialPayload: IAuthSenderPayload = {
type: "auth",
payload: {
...this.authPayload,
@@ -68,15 +68,15 @@ export class TS5ConnectionHandler implements ITS5ConnectionHandler {
this.ws.onopen = () => {
// Send authentication payload to TS5 client
this.ws.send(JSON.stringify(initalPayload));
this.logger.wsSent(initalPayload);
this.ws.send(JSON.stringify(initialPayload));
this.logger.wsSent(initialPayload);
};
this.ws.onclose = (event) => {
this.logger.log("WebSocket connection closed", event);
// If the connection was closed before authentication, remove the API key from local storage
// OBS weirdly caches the localstorage and is very stubborn about clearing it (even when clicken "Clear Cache")
// OBS weirdly caches the localstorage and is very stubborn about clearing it (even when clicking "Clear Cache")
if (!this.authenticated) {
this.logger.log("WebSocket connection closed before authentication");
localStorage.removeItem("apiKey");
@@ -120,6 +120,9 @@ export class TS5ConnectionHandler implements ITS5ConnectionHandler {
case "channels":
this.messageHandler.handleChannelsMessage(data);
break;
case "channelCreated":
this.messageHandler.handleChannelCreatedMessage(data);
break;
default:
this.logger.log(`No handler for event type: ${data.type}`);
break;