diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index eaff6ee186..f6cd54e474 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -54,6 +54,7 @@ import { WidgetLayoutStore, Container } from './stores/widgets/WidgetLayoutStore import { getIncomingCallToastKey } from './toasts/IncomingCallToast'; import ToastStore from './stores/ToastStore'; import IncomingCallToast from "./toasts/IncomingCallToast"; +import { SyncState } from "matrix-js-sdk/src/sync.api"; export const PROTOCOL_PSTN = 'm.protocol.pstn'; export const PROTOCOL_PSTN_PREFIXED = 'im.vector.protocol.pstn'; @@ -777,8 +778,16 @@ export default class CallHandler extends EventEmitter { // if the runtime env doesn't do VoIP, whine. if (!MatrixClientPeg.get().supportsVoip()) { Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, { - title: _t('VoIP is unsupported'), - description: _t('You cannot place VoIP calls in this browser.'), + title: _t('Calls are unsupported'), + description: _t('You cannot place calls in this browser.'), + }); + return; + } + + if (MatrixClientPeg.get().getSyncState() === SyncState.Error) { + Modal.createTrackedDialog('Call Handler', 'Sync error', ErrorDialog, { + title: _t('Connectivity to the server has been lost'), + description: _t('You cannot place calls without a connection to the server.'), }); return; } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1154d242ad..bc0f5da8f1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -55,8 +55,10 @@ "No other application is using the webcam": "No other application is using the webcam", "Already in call": "Already in call", "You're already in a call with this person.": "You're already in a call with this person.", - "VoIP is unsupported": "VoIP is unsupported", - "You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.", + "Calls are unsupported": "Calls are unsupported", + "You cannot place calls in this browser.": "You cannot place calls in this browser.", + "Connectivity to the server has been lost": "Connectivity to the server has been lost", + "You cannot place calls without a connection to the server.": "You cannot place calls without a connection to the server.", "Too Many Calls": "Too Many Calls", "You've reached the maximum number of simultaneous calls.": "You've reached the maximum number of simultaneous calls.", "You cannot place a call with yourself.": "You cannot place a call with yourself.",