mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-08 10:12:50 +00:00
Receivers: Fixed logic issues with connection monitor
This commit is contained in:
parent
270a998e18
commit
9b47627801
9 changed files with 39 additions and 57 deletions
|
@ -16,13 +16,11 @@ window.addEventListener('resize', (event) => calculateQRCodeWidth());
|
|||
|
||||
connectionMonitor.setUiUpdateCallbacks({
|
||||
onConnect: (connections: string[], connectionInfo: any) => {
|
||||
console.log(`Device connected: ${JSON.stringify(connectionInfo)}`);
|
||||
connectionStatusText.textContent = connections.length > 1 ? 'Multiple devices connected:\r\n Ready to cast' : 'Connected: Ready to cast';
|
||||
connectionStatusSpinner.style.display = 'none';
|
||||
connectionStatusCheck.style.display = 'inline-block';
|
||||
},
|
||||
onDisconnect: (connections: string[], connectionInfo: any) => {
|
||||
console.log(`Device disconnected: ${JSON.stringify(connectionInfo)}`);
|
||||
if (connections.length === 0) {
|
||||
connectionStatusText.textContent = 'Waiting for a connection';
|
||||
connectionStatusSpinner.style.display = 'inline-block';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue