From 22c4842154f3ef8ee60f89972257d315b0cede4b Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 29 May 2019 20:44:20 +0900 Subject: [PATCH] https://github.com/syuilo/misskey/pull/4549#discussion_r287750004 --- src/client/app/boot.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 29052c151..144933465 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -84,9 +84,14 @@ // Detect the user agent const ua = navigator.userAgent.toLowerCase(); - const isMobile = settings.device.appTypeForce === 'mobile' || - (settings.device.appTypeForce !== 'desktop' - && (/mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576)); + let isMobile = /mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576 + if (settings && settings.device.appTypeForce) { + if (settings.device.appTypeForce === 'mobile') { + isMobile = true + } else if (settings.device.appTypeForce === 'desktop') { + isMobile = false + } + } // Get the element const head = document.getElementsByTagName('head')[0];