diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts index 5e0c7d2f3b..a09af799be 100644 --- a/src/client/app/common/mios.ts +++ b/src/client/app/common/mios.ts @@ -444,7 +444,7 @@ export default class MiOS extends EventEmitter { // Append a credential if (this.isSignedIn) (data as any).i = this.i.token; - const viaStream = localStorage.getItem('enableExperimental') == 'true'; + const viaStream = localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true; return new Promise((resolve, reject) => { if (viaStream) { @@ -452,6 +452,8 @@ export default class MiOS extends EventEmitter { const id = Math.random().toString(); stream.once(`api-res:${id}`, res => { + if (--pending === 0) spinner.parentNode.removeChild(spinner); + if (res.res) { resolve(res.res); } else { @@ -503,7 +505,7 @@ export default class MiOS extends EventEmitter { reject(body.error); } }).catch(reject); - /*}*/ + } }); } diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index 4184ae82c7..2b5aa30246 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -26,6 +26,12 @@ ウィンドウが開かれるとき、ポップアウト(ブラウザ外に切り離す)可能なら自動でポップアウトします。この設定はブラウザに記憶されます。 +
+ 詳細設定 + + この設定をオンにすると、websocket接続を経由してAPIリクエストが行われます(パフォーマンス向上が期待できます)。オフにすると、ネイティブの fetch APIが利用されます。この設定はこのデバイスのみ有効です。 + +
@@ -223,6 +229,7 @@ export default Vue.extend({ checkingForUpdate: false, enableSounds: localStorage.getItem('enableSounds') == 'true', autoPopout: localStorage.getItem('autoPopout') == 'true', + apiViaStream: localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true, soundVolume: localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) : 100, lang: localStorage.getItem('lang') || '', preventUpdate: localStorage.getItem('preventUpdate') == 'true', @@ -240,6 +247,9 @@ export default Vue.extend({ autoPopout() { localStorage.setItem('autoPopout', this.autoPopout ? 'true' : 'false'); }, + apiViaStream() { + localStorage.setItem('apiViaStream', this.apiViaStream ? 'true' : 'false'); + }, enableSounds() { localStorage.setItem('enableSounds', this.enableSounds ? 'true' : 'false'); },