Files
jitsi-meet/react/features/old-client-notification/functions.ts
Calinteodor 48a6472b3b feat(lobby/prejoin/native): style updates (#12615)
feat(lobby/prejoin/native): style updates (#12615)
2022-11-25 13:59:45 +02:00

28 lines
708 B
TypeScript

import { browser } from '../base/lib-jitsi-meet';
/**
* Returns true if Jitsi Meet is running in too old jitsi-meet-electron app and false otherwise.
*
* @returns {boolean} - True if Jitsi Meet is running in too old jitsi-meet-electron app and false otherwise.
*/
export function isOldJitsiMeetElectronApp() {
if (!browser.isElectron()) {
return false;
}
// @ts-ignore
const match = navigator.userAgent.match(/(JitsiMeet)\s*\/\s*((\d+)\.[^\s]*)/);
if (!Array.isArray(match) || match.length < 3) {
return false;
}
const majorVersion = Number(match[3]);
if (isNaN(majorVersion) || majorVersion >= 2022) {
return false;
}
return true;
}