Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c222c55

Browse files
Don't allow calls when the connection the server has been lost (#7287)
1 parent d4813f7 commit c222c55

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/CallHandler.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { WidgetLayoutStore, Container } from './stores/widgets/WidgetLayoutStore
5454
import { getIncomingCallToastKey } from './toasts/IncomingCallToast';
5555
import ToastStore from './stores/ToastStore';
5656
import IncomingCallToast from "./toasts/IncomingCallToast";
57+
import { SyncState } from "matrix-js-sdk/src/sync.api";
5758

5859
export const PROTOCOL_PSTN = 'm.protocol.pstn';
5960
export const PROTOCOL_PSTN_PREFIXED = 'im.vector.protocol.pstn';
@@ -777,8 +778,16 @@ export default class CallHandler extends EventEmitter {
777778
// if the runtime env doesn't do VoIP, whine.
778779
if (!MatrixClientPeg.get().supportsVoip()) {
779780
Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, {
780-
title: _t('VoIP is unsupported'),
781-
description: _t('You cannot place VoIP calls in this browser.'),
781+
title: _t('Calls are unsupported'),
782+
description: _t('You cannot place calls in this browser.'),
783+
});
784+
return;
785+
}
786+
787+
if (MatrixClientPeg.get().getSyncState() === SyncState.Error) {
788+
Modal.createTrackedDialog('Call Handler', 'Sync error', ErrorDialog, {
789+
title: _t('Connectivity to the server has been lost'),
790+
description: _t('You cannot place calls without a connection to the server.'),
782791
});
783792
return;
784793
}

src/i18n/strings/en_EN.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
"No other application is using the webcam": "No other application is using the webcam",
5656
"Already in call": "Already in call",
5757
"You're already in a call with this person.": "You're already in a call with this person.",
58-
"VoIP is unsupported": "VoIP is unsupported",
59-
"You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.",
58+
"Calls are unsupported": "Calls are unsupported",
59+
"You cannot place calls in this browser.": "You cannot place calls in this browser.",
60+
"Connectivity to the server has been lost": "Connectivity to the server has been lost",
61+
"You cannot place calls without a connection to the server.": "You cannot place calls without a connection to the server.",
6062
"Too Many Calls": "Too Many Calls",
6163
"You've reached the maximum number of simultaneous calls.": "You've reached the maximum number of simultaneous calls.",
6264
"You cannot place a call with yourself.": "You cannot place a call with yourself.",

0 commit comments

Comments
 (0)