Debug Channel logging for 'Unwatch' SFX bug

A user reported that they hear the 'Unwatch' sound effect play more
often than they should, including when his camera isn't even active.

Only the BareRTC unwatch command makes the page play that sound effect,
so some debug messages will post in the Debug Log channel to check if I
hear the sound effect.
This commit is contained in:
Noah 2025-05-29 20:27:43 -07:00
parent 750c609854
commit 4179cba30a

View File

@ -663,6 +663,12 @@ class WebRTCController {
this.playSound("Watch");
},
onUnwatch(msg) {
this.DebugChannel(`<strong>BareRTC Unwatch</strong> received from: ${msg.username}<br><br>` +
`Current watching: ${JSON.stringify(Object.keys(this.webcam.watching))}<br>` +
`Was in watch list: ${this.webcam.watching[msg.username] == undefined ? 'NO!' : 'YES'}<br>` +
`My camera is: ${this.webcam.active ? 'active': 'not active'}`,
);
// The user has closed our video feed.
delete (this.webcam.watching[msg.username]);
this.playSound("Unwatch");