fix device detection in setup

This commit is contained in:
azivner 2019-01-14 23:50:45 +01:00
parent 2b64cbce2c
commit e50f9cd0a3

View File

@ -151,11 +151,15 @@ function bindShortcut(keyboardShortcut, handler) {
} }
function isMobile() { 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() { 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) { function setCookie(name, value) {