simplified code a little bit

This commit is contained in:
or-else
2022-06-29 12:20:43 -07:00
parent dcf9e1d47e
commit 2a00791a1b
5 changed files with 7 additions and 16 deletions
+3 -7
View File
@@ -1811,14 +1811,10 @@ class TinodeWeb extends React.Component {
// See if we need to display incoming call UI.
const topic = this.tinode.getTopic(data.topic);
if (topic) {
// Check if we have a later version of the message (which means the call
// has been either accepted or finished).
let isNewCall = true;
// Check if a later version of the message exists (which means the call
// has been either accepted or finished already).
const msg = topic.latestMsgVersion(data.seq) || data;
if (msg.head.webrtc && msg.head.webrtc != CALL_HEAD_STARTED) {
isNewCall = false;
}
if (isNewCall) {
if (msg.head && msg.head.webrtc && msg.head.webrtc == CALL_HEAD_STARTED) {
// This is a legit new call.
if (data.from != this.state.myUserId) {
if (this.state.callState == CALL_STATE_NONE) {
+1 -6
View File
@@ -9423,14 +9423,9 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
const topic = this.tinode.getTopic(data.topic);
if (topic) {
let isNewCall = true;
const msg = topic.latestMsgVersion(data.seq) || data;
if (msg.head.webrtc && msg.head.webrtc != _constants_js__WEBPACK_IMPORTED_MODULE_13__.CALL_HEAD_STARTED) {
isNewCall = false;
}
if (isNewCall) {
if (msg.head && msg.head.webrtc && msg.head.webrtc == _constants_js__WEBPACK_IMPORTED_MODULE_13__.CALL_HEAD_STARTED) {
if (data.from != this.state.myUserId) {
if (this.state.callState == _constants_js__WEBPACK_IMPORTED_MODULE_13__.CALL_STATE_NONE) {
this.setState({
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long