mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(connection): Detects tenant hyphen and length problems and show notification.
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
d438292d2c
commit
6af4d182d0
@@ -38,6 +38,7 @@ import {
|
||||
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
||||
import StateListenerRegistry from '../redux/StateListenerRegistry';
|
||||
import { TRACK_ADDED, TRACK_REMOVED } from '../tracks/actionTypes';
|
||||
import { parseURIString } from '../util/uri';
|
||||
|
||||
import {
|
||||
CONFERENCE_FAILED,
|
||||
@@ -421,13 +422,27 @@ function _connectionFailed({ dispatch, getState }: IStore, next: Function, actio
|
||||
}
|
||||
|
||||
if (error.name === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED) {
|
||||
let notificationAction: Function = showNotification;
|
||||
const notificationProps = {
|
||||
customActionNameKey: [ 'dialog.rejoinNow' ],
|
||||
customActionHandler: [ () => dispatch(reloadNow()) ],
|
||||
descriptionKey: 'notify.connectionFailed'
|
||||
} as INotificationProps;
|
||||
|
||||
dispatch(showNotification(notificationProps, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
||||
const { locationURL = { href: '' } as URL } = getState()['features/base/connection'];
|
||||
const { tenant } = parseURIString(locationURL.href) || {};
|
||||
|
||||
if (tenant.startsWith('-') || tenant.endsWith('-')) {
|
||||
notificationProps.descriptionKey = 'notify.invalidTenantHyphenDescription';
|
||||
notificationProps.titleKey = 'notify.invalidTenant';
|
||||
notificationAction = showErrorNotification;
|
||||
} else if (tenant.length > 63) {
|
||||
notificationProps.descriptionKey = 'notify.invalidTenantLengthDescription';
|
||||
notificationProps.titleKey = 'notify.invalidTenant';
|
||||
notificationAction = showErrorNotification;
|
||||
}
|
||||
|
||||
dispatch(notificationAction(notificationProps, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
||||
}
|
||||
|
||||
const result = next(action);
|
||||
|
||||
Reference in New Issue
Block a user