diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2019-05-03 00:05:12 +0900 |
|---|---|---|
| committer | Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> | 2019-07-07 02:22:33 +0900 |
| commit | 788edd3622ced91806f6dc2a4c5b8b8f17069a59 (patch) | |
| tree | 66fa0be205cb764946cbd5f0221ad2a72b48a917 /src | |
| parent | clean up (diff) | |
| download | misskey-788edd3622ced91806f6dc2a4c5b8b8f17069a59.tar.gz misskey-788edd3622ced91806f6dc2a4c5b8b8f17069a59.tar.bz2 misskey-788edd3622ced91806f6dc2a4c5b8b8f17069a59.zip | |
fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/boot.js | 16 | ||||
| -rw-r--r-- | src/client/app/common/views/components/settings/app-type.vue | 5 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 87a12e5cfa..29052c1519 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 - window.appType = null; + let app = null; - if (`${url.pathname}/`.startsWith('/docs/')) window.appType = 'docs'; - if (`${url.pathname}/`.startsWith('/dev/')) window.appType = 'dev'; - if (`${url.pathname}/`.startsWith('/auth/')) window.appType = 'auth'; - if (`${url.pathname}/`.startsWith('/admin/')) window.appType = 'admin'; + 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'; //#endregion // Script version @@ -105,15 +105,15 @@ } // Switch desktop or mobile version - if (window.appType == null) { - window.appType = isMobile ? 'mobile' : 'desktop'; + if (app == null) { + app = 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/${window.appType}.${ver}.js`); + script.setAttribute('src', `/assets/${app}.${ver}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); diff --git a/src/client/app/common/views/components/settings/app-type.vue b/src/client/app/common/views/components/settings/app-type.vue index 61a23866e2..90ff28803b 100644 --- a/src/client/app/common/views/components/settings/app-type.vue +++ b/src/client/app/common/views/components/settings/app-type.vue @@ -7,7 +7,6 @@ <ui-select v-model="appTypeForce" :placeholder="$t('intro')"> <option v-for="x in ['auto', 'desktop', 'mobile']" :value="x" :key="x">{{ $t(`choices.${x}`) }}</option> </ui-select> - <ui-info>Current: <i>{{ $t(currentAppType) }}</i></ui-info> <ui-info warn>{{ $t('info') }}</ui-info> </section> </ui-card> @@ -19,12 +18,10 @@ import i18n from '../../../../i18n'; import { faMobileAlt } from '@fortawesome/free-solid-svg-icons' export default Vue.extend({ - i18n: i18n('common/views/components/settings/client-mode.vue'), + i18n: i18n('common/views/components/settings/app-type.vue'), data() { return { - currentAppType: (window as any).appType, - faMobileAlt }; }, |