Some bug fixes
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}, {
|
||||
|
@@ -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';
|
||||
|
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
// 自分の情報が更新されたとき
|
||||
|
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -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
|
||||
});
|
||||
}
|
||||
|
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -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(() => {
|
||||
|
@@ -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();
|
||||
}
|
||||
}, {
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user