mirror of
https://github.com/kerberos-io/agent.git
synced 2026-04-22 15:47:06 +08:00
Remove extraneous trailing commas in Dashboard
Clean up trailing commas and minor formatting in ui/src/pages/Dashboard/Dashboard.jsx. Adjusts object/argument commas and formatting around WebRTC message handling, peer connection setup, error handling, and SD liveview fallback callbacks to avoid potential syntax/lint issues.
This commit is contained in:
@@ -252,7 +252,7 @@ class Dashboard extends React.Component {
|
||||
client_id: this.webrtcClientId,
|
||||
message_type: messageType,
|
||||
message,
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class Dashboard extends React.Component {
|
||||
await this.flushPendingRemoteCandidates();
|
||||
} catch (error) {
|
||||
this.fallbackToSDLiveview(
|
||||
`Unable to apply WebRTC answer: ${error.message}`,
|
||||
`Unable to apply WebRTC answer: ${error.message}`
|
||||
);
|
||||
}
|
||||
break;
|
||||
@@ -304,7 +304,7 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
} catch (error) {
|
||||
this.fallbackToSDLiveview(
|
||||
`Unable to apply WebRTC candidate: ${error.message}`,
|
||||
`Unable to apply WebRTC candidate: ${error.message}`
|
||||
);
|
||||
}
|
||||
break;
|
||||
@@ -312,7 +312,7 @@ class Dashboard extends React.Component {
|
||||
|
||||
case 'webrtc-error':
|
||||
this.fallbackToSDLiveview(
|
||||
message.message || 'The agent could not start the WebRTC liveview.',
|
||||
message.message || 'The agent could not start the WebRTC liveview.'
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -339,7 +339,7 @@ class Dashboard extends React.Component {
|
||||
});
|
||||
} catch (error) {
|
||||
this.fallbackToSDLiveview(
|
||||
`Unable to initialise WebRTC liveview: ${error.message}`,
|
||||
`Unable to initialise WebRTC liveview: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -359,7 +359,7 @@ class Dashboard extends React.Component {
|
||||
await this.webrtcPeerConnection.addIceCandidate(candidateInit);
|
||||
} catch (error) {
|
||||
this.fallbackToSDLiveview(
|
||||
`Unable to add remote ICE candidate: ${error.message}`,
|
||||
`Unable to add remote ICE candidate: ${error.message}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -378,7 +378,7 @@ class Dashboard extends React.Component {
|
||||
this.pendingRemoteCandidates = [];
|
||||
|
||||
this.webrtcPeerConnection = new window.RTCPeerConnection(
|
||||
this.buildPeerConnectionConfig(),
|
||||
this.buildPeerConnectionConfig()
|
||||
);
|
||||
|
||||
this.webrtcPeerConnection.ontrack = (event) => {
|
||||
@@ -421,7 +421,7 @@ class Dashboard extends React.Component {
|
||||
connectionState === 'closed'
|
||||
) {
|
||||
this.fallbackToSDLiveview(
|
||||
`WebRTC connection ${connectionState}, falling back to SD liveview.`,
|
||||
`WebRTC connection ${connectionState}, falling back to SD liveview.`
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -445,7 +445,7 @@ class Dashboard extends React.Component {
|
||||
const { liveviewLoaded } = this.state;
|
||||
if (!liveviewLoaded) {
|
||||
this.fallbackToSDLiveview(
|
||||
'WebRTC connection timed out, falling back to SD liveview.',
|
||||
'WebRTC connection timed out, falling back to SD liveview.'
|
||||
);
|
||||
}
|
||||
}, 10000);
|
||||
@@ -478,7 +478,7 @@ class Dashboard extends React.Component {
|
||||
},
|
||||
() => {
|
||||
this.initialiseSDLiveview();
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user