summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-08 03:58:11 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-08 03:58:11 +0900
commita02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8 (patch)
treebf3c3dacd69737bf79eea0311fed1ddc504b15a5 /src/client/app/common
parentPost --> Note (diff)
downloadsharkey-a02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8.tar.gz
sharkey-a02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8.tar.bz2
sharkey-a02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8.zip
Some bug fixes
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/define-widget.ts4
-rw-r--r--src/client/app/common/mios.ts10
-rw-r--r--src/client/app/common/scripts/streaming/drive.ts2
-rw-r--r--src/client/app/common/scripts/streaming/home.ts4
-rw-r--r--src/client/app/common/scripts/streaming/messaging-index.ts2
-rw-r--r--src/client/app/common/scripts/streaming/messaging.ts4
-rw-r--r--src/client/app/common/scripts/streaming/othello-game.ts2
-rw-r--r--src/client/app/common/scripts/streaming/othello.ts2
-rw-r--r--src/client/app/common/views/components/signin.vue4
-rw-r--r--src/client/app/common/views/components/twitter-setting.vue12
-rw-r--r--src/client/app/common/views/components/uploader.vue2
11 files changed, 24 insertions, 24 deletions
diff --git a/src/client/app/common/define-widget.ts b/src/client/app/common/define-widget.ts
index 9f8dcfc7ea..7b98c0903f 100644
--- a/src/client/app/common/define-widget.ts
+++ b/src/client/app/common/define-widget.ts
@@ -56,14 +56,14 @@ export default function<T extends object>(data: {
id: this.id,
data: newProps
}).then(() => {
- (this as any).os.i.account.clientSettings.mobileHome.find(w => w.id == this.id).data = newProps;
+ (this as any).os.i.clientSettings.mobileHome.find(w => w.id == this.id).data = newProps;
});
} else {
(this as any).api('i/update_home', {
id: this.id,
data: newProps
}).then(() => {
- (this as any).os.i.account.clientSettings.home.find(w => w.id == this.id).data = newProps;
+ (this as any).os.i.clientSettings.home.find(w => w.id == this.id).data = newProps;
});
}
}, {
diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts
index 48e830810c..fd267bc3f8 100644
--- a/src/client/app/common/mios.ts
+++ b/src/client/app/common/mios.ts
@@ -270,7 +270,7 @@ export default class MiOS extends EventEmitter {
// Parse response
res.json().then(i => {
me = i;
- me.account.token = token;
+ me.token = token;
done();
});
})
@@ -294,12 +294,12 @@ export default class MiOS extends EventEmitter {
const fetched = me => {
if (me) {
// デフォルトの設定をマージ
- me.account.clientSettings = Object.assign({
+ me.clientSettings = Object.assign({
fetchOnScroll: true,
showMaps: true,
showPostFormOnTopOfTl: false,
gradientWindowHeader: false
- }, me.account.clientSettings);
+ }, me.clientSettings);
// ローカルストレージにキャッシュ
localStorage.setItem('me', JSON.stringify(me));
@@ -329,7 +329,7 @@ export default class MiOS extends EventEmitter {
fetched(cachedMe);
// 後から新鮮なデータをフェッチ
- fetchme(cachedMe.account.token, freshData => {
+ fetchme(cachedMe.token, freshData => {
merge(cachedMe, freshData);
});
} else {
@@ -437,7 +437,7 @@ export default class MiOS extends EventEmitter {
}
// Append a credential
- if (this.isSignedIn) (data as any).i = this.i.account.token;
+ if (this.isSignedIn) (data as any).i = this.i.token;
// TODO
//const viaStream = localStorage.getItem('enableExperimental') == 'true';
diff --git a/src/client/app/common/scripts/streaming/drive.ts b/src/client/app/common/scripts/streaming/drive.ts
index f11573685e..7ff85b5946 100644
--- a/src/client/app/common/scripts/streaming/drive.ts
+++ b/src/client/app/common/scripts/streaming/drive.ts
@@ -8,7 +8,7 @@ import MiOS from '../../mios';
export class DriveStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'drive', {
- i: me.account.token
+ i: me.token
});
}
}
diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts
index c198619400..e085801e15 100644
--- a/src/client/app/common/scripts/streaming/home.ts
+++ b/src/client/app/common/scripts/streaming/home.ts
@@ -10,13 +10,13 @@ import MiOS from '../../mios';
export class HomeStream extends Stream {
constructor(os: MiOS, me) {
super(os, '', {
- i: me.account.token
+ i: me.token
});
// 最終利用日時を更新するため定期的にaliveメッセージを送信
setInterval(() => {
this.send({ type: 'alive' });
- me.account.lastUsedAt = new Date();
+ me.lastUsedAt = new Date();
}, 1000 * 60);
// 自分の情報が更新されたとき
diff --git a/src/client/app/common/scripts/streaming/messaging-index.ts b/src/client/app/common/scripts/streaming/messaging-index.ts
index 24f0ce0c9f..84e2174ec4 100644
--- a/src/client/app/common/scripts/streaming/messaging-index.ts
+++ b/src/client/app/common/scripts/streaming/messaging-index.ts
@@ -8,7 +8,7 @@ import MiOS from '../../mios';
export class MessagingIndexStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'messaging-index', {
- i: me.account.token
+ i: me.token
});
}
}
diff --git a/src/client/app/common/scripts/streaming/messaging.ts b/src/client/app/common/scripts/streaming/messaging.ts
index 4c593deb31..c1b5875cfb 100644
--- a/src/client/app/common/scripts/streaming/messaging.ts
+++ b/src/client/app/common/scripts/streaming/messaging.ts
@@ -7,13 +7,13 @@ import MiOS from '../../mios';
export class MessagingStream extends Stream {
constructor(os: MiOS, me, otherparty) {
super(os, 'messaging', {
- i: me.account.token,
+ i: me.token,
otherparty
});
(this as any).on('_connected_', () => {
this.send({
- i: me.account.token
+ i: me.token
});
});
}
diff --git a/src/client/app/common/scripts/streaming/othello-game.ts b/src/client/app/common/scripts/streaming/othello-game.ts
index f34ef35147..b85af8f72b 100644
--- a/src/client/app/common/scripts/streaming/othello-game.ts
+++ b/src/client/app/common/scripts/streaming/othello-game.ts
@@ -4,7 +4,7 @@ import MiOS from '../../mios';
export class OthelloGameStream extends Stream {
constructor(os: MiOS, me, game) {
super(os, 'othello-game', {
- i: me ? me.account.token : null,
+ i: me ? me.token : null,
game: game.id
});
}
diff --git a/src/client/app/common/scripts/streaming/othello.ts b/src/client/app/common/scripts/streaming/othello.ts
index 8c6f4b9c3c..f5d47431cd 100644
--- a/src/client/app/common/scripts/streaming/othello.ts
+++ b/src/client/app/common/scripts/streaming/othello.ts
@@ -5,7 +5,7 @@ import MiOS from '../../mios';
export class OthelloStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'othello', {
- i: me.account.token
+ i: me.token
});
}
}
diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue
index 17154e6b31..da7472b8c7 100644
--- a/src/client/app/common/views/components/signin.vue
+++ b/src/client/app/common/views/components/signin.vue
@@ -6,7 +6,7 @@
<label class="password">
<input v-model="password" type="password" placeholder="%i18n:common.tags.mk-signin.password%" required/>%fa:lock%
</label>
- <label class="token" v-if="user && user.account.twoFactorEnabled">
+ <label class="token" v-if="user && user.twoFactorEnabled">
<input v-model="token" type="number" placeholder="%i18n:common.tags.mk-signin.token%" required/>%fa:lock%
</label>
<button type="submit" :disabled="signing">{{ signing ? '%i18n:common.tags.mk-signin.signing-in%' : '%i18n:common.tags.mk-signin.signin%' }}</button>
@@ -43,7 +43,7 @@ export default Vue.extend({
(this as any).api('signin', {
username: this.username,
password: this.password,
- token: this.user && this.user.account.twoFactorEnabled ? this.token : undefined
+ token: this.user && this.user.twoFactorEnabled ? this.token : undefined
}).then(() => {
location.reload();
}).catch(() => {
diff --git a/src/client/app/common/views/components/twitter-setting.vue b/src/client/app/common/views/components/twitter-setting.vue
index 082d2b435d..00669cd833 100644
--- a/src/client/app/common/views/components/twitter-setting.vue
+++ b/src/client/app/common/views/components/twitter-setting.vue
@@ -1,13 +1,13 @@
<template>
<div class="mk-twitter-setting">
<p>%i18n:common.tags.mk-twitter-setting.description%<a :href="`${docsUrl}/link-to-twitter`" target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
- <p class="account" v-if="os.i.account.twitter" :title="`Twitter ID: ${os.i.account.twitter.userId}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.account.twitter.screenName}`" target="_blank">@{{ os.i.account.twitter.screenName }}</a></p>
+ <p class="account" v-if="os.i.twitter" :title="`Twitter ID: ${os.i.twitter.userId}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.twitter.screenName}`" target="_blank">@{{ os.i.twitter.screenName }}</a></p>
<p>
- <a :href="`${apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">{{ os.i.account.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }}</a>
- <span v-if="os.i.account.twitter"> or </span>
- <a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.account.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
+ <a :href="`${apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">{{ os.i.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }}</a>
+ <span v-if="os.i.twitter"> or </span>
+ <a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p>
- <p class="id" v-if="os.i.account.twitter">Twitter ID: {{ os.i.account.twitter.userId }}</p>
+ <p class="id" v-if="os.i.twitter">Twitter ID: {{ os.i.twitter.userId }}</p>
</div>
</template>
@@ -25,7 +25,7 @@ export default Vue.extend({
},
mounted() {
this.$watch('os.i', () => {
- if ((this as any).os.i.account.twitter) {
+ if ((this as any).os.i.twitter) {
if (this.form) this.form.close();
}
}, {
diff --git a/src/client/app/common/views/components/uploader.vue b/src/client/app/common/views/components/uploader.vue
index c74a1edb41..ccad50dc37 100644
--- a/src/client/app/common/views/components/uploader.vue
+++ b/src/client/app/common/views/components/uploader.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
reader.readAsDataURL(file);
const data = new FormData();
- data.append('i', (this as any).os.i.account.token);
+ data.append('i', (this as any).os.i.token);
data.append('file', file);
if (folder) data.append('folderId', folder);