Files
jitsi-meet/react/features/old-client-notification/functions.js
Christoph Settgast 0d9c4318ba feat(old-client-notification) bump notice for anything older than 2022
Bumped to catch old macOS versions which were not signed and thus did
not have autoupdater working (ie. everything older than
https://github.com/jitsi/jitsi-meet-electron/releases/tag/v2021.11.2)

Signed-off-by: Christoph Settgast <csett86@web.de>
2022-07-25 07:47:33 +02:00

29 lines
721 B
JavaScript

// @flow
import { browser } from '../../../react/features/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;
}
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;
}