diff --git a/src/app/mainview/components/ChatView.qml b/src/app/mainview/components/ChatView.qml index a07809c1a45dc601acef3b3352f0e04b302613e9..9cf0890b0286794bf78fe61ddda475f439c88def 100644 --- a/src/app/mainview/components/ChatView.qml +++ b/src/app/mainview/components/ChatView.qml @@ -167,15 +167,6 @@ Rectangle { target: CurrentConversation enabled: true - function onActiveCallsChanged() { - if (CurrentConversation.activeCalls.length > 0) { - notificationArea.id = CurrentConversation.activeCalls[0]["id"]; - notificationArea.uri = CurrentConversation.activeCalls[0]["uri"]; - notificationArea.device = CurrentConversation.activeCalls[0]["device"]; - } - notificationArea.visible = CurrentConversation.activeCalls.length > 0 && !root.inCallView; - } - function onErrorsChanged() { if (CurrentConversation.errors.length > 0) { errorRect.errorLabel.text = CurrentConversation.errors[0]; diff --git a/src/app/mainview/components/NotificationArea.qml b/src/app/mainview/components/NotificationArea.qml index 4eaba8519256fd565367ff5f8bbc5daa525c4f62..395e54f37a1aa96e5941a7075b4f71f7b921e8db 100644 --- a/src/app/mainview/components/NotificationArea.qml +++ b/src/app/mainview/components/NotificationArea.qml @@ -29,9 +29,7 @@ Rectangle { opacity: visible color: CurrentConversation.color - property string id: "" - property string uri: "" - property string device: "" + property var activeCall: CurrentConversation.activeCalls.length > 0 ? CurrentConversation.activeCalls[0] : null property string textColor: UtilsAdapter.luma(root.color) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark RowLayout { @@ -64,7 +62,10 @@ Rectangle { border.width: 1 border.color: root.textColor - onClicked: MessagesAdapter.joinCall(uri, device, id, true) + onClicked: { + if (activeCall !== null) + MessagesAdapter.joinCall(activeCall["uri"], activeCall["device"], activeCall["id"], true) + } } PushButton { @@ -82,7 +83,10 @@ Rectangle { border.color: root.textColor visible: CurrentAccount.videoEnabled_Video - onClicked: MessagesAdapter.joinCall(uri, device, id) + onClicked: { + if (activeCall !== null) + MessagesAdapter.joinCall(activeCall["uri"], activeCall["device"], activeCall["id"]) + } } PushButton { @@ -94,7 +98,10 @@ Rectangle { source: JamiResources.round_close_24dp_svg - onClicked: ConversationsAdapter.ignoreActiveCall(CurrentConversation.id, id, uri, device) + onClicked: { + if (activeCall !== null) + ConversationsAdapter.ignoreActiveCall(CurrentConversation.id, activeCall["id"], activeCall["uri"], activeCall["device"]) + } } }