Refactor & Clean up

This commit is contained in:
syuilo 2018-11-09 08:13:34 +09:00
parent ba845f5218
commit 60ef3e3563
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
154 changed files with 438 additions and 481 deletions

View file

@ -73,7 +73,7 @@ export default Vue.extend({
},
mounted() {
this.connection = (this as any).os.stream.connectToChannel('messaging', { otherparty: this.user.id });
this.connection = this.$root.stream.connectToChannel('messaging', { otherparty: this.user.id });
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);
@ -139,7 +139,7 @@ export default Vue.extend({
return new Promise((resolve, reject) => {
const max = this.existMoreMessages ? 20 : 10;
(this as any).api('messaging/messages', {
this.$root.api('messaging/messages', {
userId: this.user.id,
limit: max + 1,
untilId: this.existMoreMessages ? this.messages[0].id : undefined