mirror of https://github.com/vector-im/riot-web
Don't allow calls when the connection the server has been lost (#7287)
parent
d4813f7a1a
commit
c222c5511d
|
@ -54,6 +54,7 @@ import { WidgetLayoutStore, Container } from './stores/widgets/WidgetLayoutStore
|
||||||
import { getIncomingCallToastKey } from './toasts/IncomingCallToast';
|
import { getIncomingCallToastKey } from './toasts/IncomingCallToast';
|
||||||
import ToastStore from './stores/ToastStore';
|
import ToastStore from './stores/ToastStore';
|
||||||
import IncomingCallToast from "./toasts/IncomingCallToast";
|
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 = 'm.protocol.pstn';
|
||||||
export const PROTOCOL_PSTN_PREFIXED = 'im.vector.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 the runtime env doesn't do VoIP, whine.
|
||||||
if (!MatrixClientPeg.get().supportsVoip()) {
|
if (!MatrixClientPeg.get().supportsVoip()) {
|
||||||
Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, {
|
Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, {
|
||||||
title: _t('VoIP is unsupported'),
|
title: _t('Calls are unsupported'),
|
||||||
description: _t('You cannot place VoIP calls in this browser.'),
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,10 @@
|
||||||
"No other application is using the webcam": "No other application is using the webcam",
|
"No other application is using the webcam": "No other application is using the webcam",
|
||||||
"Already in call": "Already in call",
|
"Already in call": "Already in call",
|
||||||
"You're already in a call with this person.": "You're already in a call with this person.",
|
"You're already in a call with this person.": "You're already in a call with this person.",
|
||||||
"VoIP is unsupported": "VoIP is unsupported",
|
"Calls are unsupported": "Calls are unsupported",
|
||||||
"You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.",
|
"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",
|
"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'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.",
|
"You cannot place a call with yourself.": "You cannot place a call with yourself.",
|
||||||
|
|
Loading…
Reference in New Issue