Skip to content

Commit

Permalink
Move isFirefox and isChrome functions to rocketchat-utils (#13011)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Dec 20, 2018
1 parent e5c9be6 commit 9f53f32
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"getAvatarUrlFromUsername" : false,
"getAvatarSuggestionForUser" : false,
"globals" : true,
"isChrome" : false,
"isFirefox" : false,
"JitsiMeetExternalAPI" : false,
"jscolor" : false,
"KonchatNotification" : false,
Expand Down
3 changes: 0 additions & 3 deletions packages/rocketchat-ui-master/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import s from 'underscore.string';

RocketChat.settings.collection.find({ _id:/theme-color-rc/i }, { fields:{ value: 1 } }).observe({ changed: () => { DynamicCss.run(true); } });

this.isFirefox = navigator.userAgent.match(/Firefox\/(\d+)\.\d/);
this.isChrome = navigator.userAgent.match(/Chrome\/(\d+)\.\d/);

Template.body.onRendered(function() {
new Clipboard('.clipboard');

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui/client/components/icon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { isChrome, isFirefox } from 'meteor/rocketchat:utils';

const baseUrlFix = () => `${ window.location.origin }${ FlowRouter.current().path }`;

Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-utils/client/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { t, isRtl } from '../lib/tapi18n';
import { isChrome, isFirefox } from './lib/browsers';

export {
t,
isRtl,
isChrome,
isFirefox,
};
2 changes: 2 additions & 0 deletions packages/rocketchat-utils/client/lib/browsers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const isFirefox = navigator.userAgent.match(/Firefox\/(\d+)\.\d/);
export const isChrome = navigator.userAgent.match(/Chrome\/(\d+)\.\d/);

0 comments on commit 9f53f32

Please sign in to comment.