diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2019-05-29 20:44:20 +0900 |
|---|---|---|
| committer | Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> | 2019-07-07 02:22:33 +0900 |
| commit | 22c4842154f3ef8ee60f89972257d315b0cede4b (patch) | |
| tree | 8c3c2fcdcdbce63d8261a663482ae0c8b05c550f /src/client | |
| parent | fix (diff) | |
| download | misskey-22c4842154f3ef8ee60f89972257d315b0cede4b.tar.gz misskey-22c4842154f3ef8ee60f89972257d315b0cede4b.tar.bz2 misskey-22c4842154f3ef8ee60f89972257d315b0cede4b.zip | |
https://github.com/syuilo/misskey/pull/4549#discussion_r287750004
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/boot.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 29052c1519..1449334657 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 <head> element const head = document.getElementsByTagName('head')[0]; |