You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Don't allow calls when the connection the server has been lost (#7287)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user