Skip to content

Commit 15b95e2

Browse files
committed
Do more clean up
1 parent 4621aa3 commit 15b95e2

3 files changed

Lines changed: 7 additions & 45 deletions

File tree

app/component/CustomInputTime.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export default async function serve(req, res, next) {
9999
try {
100100
const config = getConfiguration(req);
101101
const agent = req.headers['user-agent'];
102-
global.navigator = { userAgent: agent };
103102

104103
// TODO: Move this to PreferencesStore
105104
// 1. use locale from cookie (user selected) or default

app/util/browser.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
export const isBrowser = typeof window !== 'undefined' && window !== null;
1+
const isBrowser = typeof window !== 'undefined' && window !== null;
2+
const isFirefox = isBrowser && navigator.userAgent.match(/Firefox/) != null;
3+
const isEdge = isBrowser && navigator.userAgent.match(/Edge/) != null;
4+
const isChrome =
5+
isBrowser && !isEdge && navigator.userAgent.match(/Chrome/) != null;
6+
const isIe = isBrowser && navigator.userAgent.match(/Trident/) != null;
7+
28
export const isIOS =
39
isBrowser && !!navigator.platform.match(/iPhone|iPod|iPad/);
4-
export const isWindowsPhone =
5-
isBrowser && navigator.userAgent.match(/Windows Phone/) != null;
610
export const isLangMockEn =
711
isBrowser && window.location.search.indexOf('enmock') !== -1;
812
export const isMobile =
913
isBrowser && navigator.userAgent.match(/Mobile/) != null;
10-
export const isFirefox =
11-
isBrowser && navigator.userAgent.match(/Firefox/) != null;
1214
export const isAndroid =
1315
isBrowser && navigator.userAgent.match(/Android/) != null;
14-
export const isEdge = isBrowser && navigator.userAgent.match(/Edge/) != null;
15-
export const isChrome =
16-
isBrowser && !isEdge && navigator.userAgent.match(/Chrome/) != null;
1716
export const isSafari =
1817
isBrowser &&
1918
!isChrome &&
2019
!isEdge &&
2120
navigator.userAgent.match(/Safari/) != null;
22-
export const isSamsungBrowser =
23-
isBrowser && navigator.userAgent.match(/SamsungBrowser/) != null;
24-
const isIe = isBrowser && navigator.userAgent.match(/Trident/) != null;
2521
export const isImperial = config => {
2622
if (
2723
config.imperialEnabled &&

0 commit comments

Comments
 (0)