The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/ui/client/components/icon.js

24 lines
816 B

import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { baseURI } from '../../../../client/lib/baseURI';
import './icon.html';
const baseUrlFix = () => `${baseURI}${FlowRouter.current().path.substring(1)}`;
const isMozillaFirefoxBelowVersion = (upperVersion) => {
const [, version] = navigator.userAgent.match(/Firefox\/(\d+)\.\d/) || [];
return parseInt(version, 10) < upperVersion;
};
const isGoogleChromeBelowVersion = (upperVersion) => {
const [, version] = navigator.userAgent.match(/Chrome\/(\d+)\.\d/) || [];
return parseInt(version, 10) < upperVersion;
};
const isBaseUrlFixNeeded = () => isMozillaFirefoxBelowVersion(55) || isGoogleChromeBelowVersion(55);
Template.icon.helpers({
baseUrl: isBaseUrlFixNeeded() ? baseUrlFix : undefined,
});