summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-04-13 14:30:10 +0900
committerGitHub <noreply@github.com>2018-04-13 14:30:10 +0900
commitcdf13d30f2ad47b07d9c366e9324ff6109c15be2 (patch)
treec7facc364b259ce64c4fe78da5a0d8f723e51ada /src/client/app/common
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
parentFix bug (diff)
downloadmisskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.tar.gz
misskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.tar.bz2
misskey-cdf13d30f2ad47b07d9c366e9324ff6109c15be2.zip
Merge pull request #1460 from syuilo/koa
Koa
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/mios.ts5
-rw-r--r--src/client/app/common/views/components/url-preview.vue2
2 files changed, 4 insertions, 3 deletions
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;