From 78f53b3f6bf21037e76d9b47a5632ad4840f6ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 7 Aug 2021 21:28:35 +0200 Subject: [PATCH 1/2] Don't show modal on reject/user hangup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/CallHandler.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 77569711df..2ab77a392c 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -509,13 +509,17 @@ export default class CallHandler extends EventEmitter { this.removeCallForRoom(mappedRoomId); if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) { this.play(AudioID.Busy); + + // Don't show a modal when we got rejected/the call was hung up + if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) return; + let title; let description; // TODO: We should either do away with these or figure out a copy for each code (expect user_hangup...) if (call.hangupReason === CallErrorCode.UserBusy) { title = _t("User Busy"); description = _t("The user you called is busy."); - } else if (hangupReason && ![CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) { + } else { title = _t("Call Failed"); description = _t("The call could not be established"); } From 2d5dc6d52998a4e2fa647e7daa29bcaaa0bb6c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 7 Aug 2021 21:30:58 +0200 Subject: [PATCH 2/2] Break instead of return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/CallHandler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 2ab77a392c..41571666c3 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -511,7 +511,7 @@ export default class CallHandler extends EventEmitter { this.play(AudioID.Busy); // Don't show a modal when we got rejected/the call was hung up - if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) return; + if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) break; let title; let description;