diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-04-13 14:30:10 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-13 14:30:10 +0900 |
| commit | cdf13d30f2ad47b07d9c366e9324ff6109c15be2 (patch) | |
| tree | c7facc364b259ce64c4fe78da5a0d8f723e51ada /src/client | |
| parent | Merge branch 'master' of https://github.com/syuilo/misskey (diff) | |
| parent | Fix bug (diff) | |
| download | misskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.tar.gz misskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.tar.bz2 misskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.zip | |
Merge pull request #1460 from syuilo/koa
Koa
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/boot.js | 2 | ||||
| -rw-r--r-- | src/client/app/common/mios.ts | 5 | ||||
| -rw-r--r-- | src/client/app/common/views/components/url-preview.vue | 2 | ||||
| -rw-r--r-- | src/client/assets/404.js | 25 | ||||
| -rw-r--r-- | src/client/docs/layout.pug | 2 |
5 files changed, 7 insertions, 29 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 0846e4bd55..ef828d9637 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -97,6 +97,8 @@ // Compare versions if (meta.version != ver) { + localStorage.setItem('v', meta.version); + alert( 'Misskeyの新しいバージョンがあります。ページを再度読み込みします。' + '\n\n' + diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts index a09af799be..ccc73eebc3 100644 --- a/src/client/app/common/mios.ts +++ b/src/client/app/common/mios.ts @@ -444,9 +444,10 @@ export default class MiOS extends EventEmitter { // Append a credential if (this.isSignedIn) (data as any).i = this.i.token; - const viaStream = localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true; - return new Promise((resolve, reject) => { + const viaStream = this.stream.hasConnection && + (localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true); + if (viaStream) { const stream = this.stream.borrow(); const id = Math.random().toString(); diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index e91e510550..fd25480f61 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -45,7 +45,7 @@ export default Vue.extend({ } else if (url.hostname == 'youtu.be') { this.youtubeId = url.pathname; } else { - fetch('/api:url?url=' + this.url).then(res => { + fetch('/url?url=' + this.url).then(res => { res.json().then(info => { this.title = info.title; this.description = info.description; diff --git a/src/client/assets/404.js b/src/client/assets/404.js deleted file mode 100644 index 9e498fe7c2..0000000000 --- a/src/client/assets/404.js +++ /dev/null @@ -1,25 +0,0 @@ -const yn = window.confirm( - 'サーバー上に存在しないスクリプトがリクエストされました。お使いのMisskeyのバージョンが古いことが原因の可能性があります。Misskeyを更新しますか?\n\nA script that does not exist on the server was requested. It may be caused by an old version of Misskey you’re using. Do you want to delete the cache?'); - -const langYn = window.confirm('また、言語を日本語に設定すると解決する場合があります。日本語に設定しますか?\n\nAlso, setting the language to Japanese may solve the problem. Would you like to set it to Japanese?'); - -if (langYn) { - localStorage.setItem('lang', 'ja'); -} - -if (yn) { - // Clear cache (serive worker) - try { - navigator.serviceWorker.controller.postMessage('clear'); - - navigator.serviceWorker.getRegistrations().then(registrations => { - registrations.forEach(registration => registration.unregister()); - }); - } catch (e) { - console.error(e); - } - - localStorage.removeItem('v'); - - location.reload(true); -} diff --git a/src/client/docs/layout.pug b/src/client/docs/layout.pug index 29d2a3ff69..1d9ebcb4cd 100644 --- a/src/client/docs/layout.pug +++ b/src/client/docs/layout.pug @@ -6,7 +6,7 @@ html(lang= lang) meta(name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no") title | #{title} | Misskey Docs - link(rel="stylesheet" href="/assets/style.css") + link(rel="stylesheet" href="/docs/assets/style.css") block meta //- FontAwesome style |