2017-10-12 10:00:28 +08:00
|
|
|
import Breakouts from '/imports/api/breakouts';
|
2019-04-06 02:10:05 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
2017-03-29 02:41:48 +08:00
|
|
|
import Settings from '/imports/ui/services/settings';
|
2017-08-12 01:14:50 +08:00
|
|
|
import Auth from '/imports/ui/services/auth/index';
|
2016-05-11 03:39:01 +08:00
|
|
|
|
2017-02-25 04:19:53 +08:00
|
|
|
const getFontSize = () => {
|
2017-04-06 19:46:15 +08:00
|
|
|
const applicationSettings = Settings.application;
|
|
|
|
return applicationSettings ? applicationSettings.fontSize : '16px';
|
2016-12-23 08:44:31 +08:00
|
|
|
};
|
|
|
|
|
2018-10-24 01:18:09 +08:00
|
|
|
const getBreakoutRooms = () => Breakouts.find().fetch();
|
|
|
|
|
2017-03-17 22:23:00 +08:00
|
|
|
function meetingIsBreakout() {
|
2019-08-22 20:05:06 +08:00
|
|
|
const meeting = Meetings.findOne({ meetingId: Auth.meetingID },
|
|
|
|
{ fields: { 'meetingProp.isBreakout': 1 } });
|
2019-04-06 02:10:05 +08:00
|
|
|
return (meeting && meeting.meetingProp.isBreakout);
|
2017-03-17 22:23:00 +08:00
|
|
|
}
|
|
|
|
|
2019-04-19 01:14:34 +08:00
|
|
|
const validIOSVersion = () => {
|
|
|
|
const SUPPORTED_OS_VERSION = 12.2;
|
2019-05-01 05:35:44 +08:00
|
|
|
const iosMatch = navigator.userAgent.match(/OS (\d+)_(\d+)/);
|
2019-04-19 01:14:34 +08:00
|
|
|
if (iosMatch) {
|
|
|
|
const versionNumber = iosMatch[0].split(' ')[1].replace('_', '.');
|
|
|
|
const isInvalid = parseFloat(versionNumber) < SUPPORTED_OS_VERSION;
|
|
|
|
if (isInvalid) return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
|
2016-05-13 03:50:02 +08:00
|
|
|
export {
|
2017-02-25 04:19:53 +08:00
|
|
|
getFontSize,
|
2017-03-15 04:57:22 +08:00
|
|
|
meetingIsBreakout,
|
2018-10-24 01:18:09 +08:00
|
|
|
getBreakoutRooms,
|
2019-04-19 01:14:34 +08:00
|
|
|
validIOSVersion,
|
2016-05-12 23:41:51 +08:00
|
|
|
};
|