diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2019-04-19 11:07:54 +0900 |
|---|---|---|
| committer | Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> | 2019-07-07 02:21:13 +0900 |
| commit | 2afcdda0587b8f63b5bfd8c28348ede41b5f12ee (patch) | |
| tree | 29a01ebacd4af5b7df2fe77a02d73e671b60ba1a /src/client/app/boot.js | |
| parent | revert (diff) | |
| download | misskey-2afcdda0587b8f63b5bfd8c28348ede41b5f12ee.tar.gz misskey-2afcdda0587b8f63b5bfd8c28348ede41b5f12ee.tar.bz2 misskey-2afcdda0587b8f63b5bfd8c28348ede41b5f12ee.zip | |
wip
Diffstat (limited to 'src/client/app/boot.js')
| -rw-r--r-- | src/client/app/boot.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 01104bf715..56eb59e21e 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -35,12 +35,12 @@ const url = new URL(location.href); //#region Detect app name - let app = null; + var appType = null; - if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs'; - if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev'; - if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth'; - if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin'; + if (`${url.pathname}/`.startsWith('/docs/')) appType = 'docs'; + if (`${url.pathname}/`.startsWith('/dev/')) appType = 'dev'; + if (`${url.pathname}/`.startsWith('/auth/')) appType = 'auth'; + if (`${url.pathname}/`.startsWith('/admin/')) appType = 'admin'; //#endregion // Script version @@ -103,15 +103,15 @@ } // Switch desktop or mobile version - if (app == null) { - app = isMobile ? 'mobile' : 'desktop'; + if (appType == null) { + appType = isMobile ? 'mobile' : 'desktop'; } // Load an app script // Note: 'async' make it possible to load the script asyncly. // 'defer' make it possible to run the script when the dom loaded. const script = document.createElement('script'); - script.setAttribute('src', `/assets/${app}.${ver}.js`); + script.setAttribute('src', `/assets/${appType}.${ver}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); |