From e50f9cd0a354e29bb40c161cf7288e13b732e0d3 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 14 Jan 2019 23:50:45 +0100 Subject: [PATCH] fix device detection in setup --- src/public/javascripts/services/utils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/public/javascripts/services/utils.js b/src/public/javascripts/services/utils.js index 013f4225e..dcca082e3 100644 --- a/src/public/javascripts/services/utils.js +++ b/src/public/javascripts/services/utils.js @@ -151,11 +151,15 @@ function bindShortcut(keyboardShortcut, handler) { } function isMobile() { - return window.device === "mobile"; + return window.device === "mobile" + // window.device is not available in setup + || (!window.device && /Mobi/.test(navigator.userAgent)); } function isDesktop() { - return window.device === "desktop"; + return window.device === "desktop" + // window.device is not available in setup + || (!window.device && !/Mobi/.test(navigator.userAgent)); } function setCookie(name, value) {