a693133b5a
There are a couple of hardcoded UA checks targeted at iOS endpoints introduced circa 2.2-beta. One of those pops up an "unsupported" toast when the device joins a conference - the other blocks camera sharing. Those checks are outdated since we transitioned to minBrowserVersions approach that redirects the client to an unsupported view upon join. I also assume the checks are bugged since, in some environments, it flags iPadOS endpoints as iOS and version-checks it to a hardcoded "12.2" threshold (which is incompatible with iPadOS versioning). That caused camera sharing not to work, which is a false negative. I consider the checks to be outdated, so I removed all references to them.
53 lines
1.4 KiB
JavaScript
53 lines
1.4 KiB
JavaScript
import Breakouts from '/imports/api/breakouts';
|
|
import Meetings from '/imports/api/meetings';
|
|
import Settings from '/imports/ui/services/settings';
|
|
import Auth from '/imports/ui/services/auth/index';
|
|
import deviceInfo from '/imports/utils/deviceInfo';
|
|
import Styled from './styles';
|
|
import DarkReader from 'darkreader';
|
|
import logger from '/imports/startup/client/logger';
|
|
|
|
const getFontSize = () => {
|
|
const applicationSettings = Settings.application;
|
|
return applicationSettings ? applicationSettings.fontSize : '16px';
|
|
};
|
|
|
|
const getBreakoutRooms = () => Breakouts.find().fetch();
|
|
|
|
function meetingIsBreakout() {
|
|
const meeting = Meetings.findOne({ meetingId: Auth.meetingID },
|
|
{ fields: { 'meetingProp.isBreakout': 1 } });
|
|
return (meeting && meeting.meetingProp.isBreakout);
|
|
}
|
|
|
|
const setDarkTheme = (value) => {
|
|
if (value && !DarkReader.isEnabled()) {
|
|
DarkReader.enable(
|
|
{ brightness: 100, contrast: 90 },
|
|
{ invert: [Styled.DtfInvert], ignoreInlineStyle: [Styled.DtfCss], ignoreImageAnalysis: [Styled.DtfImages] },
|
|
)
|
|
logger.info({
|
|
logCode: 'dark_mode',
|
|
}, 'Dark mode is on.');
|
|
}
|
|
|
|
if (!value && DarkReader.isEnabled()){
|
|
DarkReader.disable();
|
|
logger.info({
|
|
logCode: 'dark_mode',
|
|
}, 'Dark mode is off.');
|
|
}
|
|
}
|
|
|
|
const isDarkThemeEnabled = () => {
|
|
return DarkReader.isEnabled()
|
|
}
|
|
|
|
export {
|
|
getFontSize,
|
|
meetingIsBreakout,
|
|
getBreakoutRooms,
|
|
setDarkTheme,
|
|
isDarkThemeEnabled,
|
|
};
|