Refactor & Clean up

This commit is contained in:
syuilo
2018-11-09 08:13:34 +09:00
parent ba845f5218
commit 60ef3e3563
154 changed files with 438 additions and 481 deletions

View File

@@ -68,7 +68,7 @@ export default Vue.extend({
},
mounted() {
this.connection = (this as any).os.stream.useSharedConnection('main');
this.connection = this.$root.stream.useSharedConnection('main');
this.connection.on('notification', this.onNotification);
@@ -77,7 +77,7 @@ export default Vue.extend({
const max = 10;
(this as any).api('i/notifications', {
this.$root.api('i/notifications', {
limit: max + 1
}).then(notifications => {
if (notifications.length == max + 1) {
@@ -103,7 +103,7 @@ export default Vue.extend({
const max = 20;
(this as any).api('i/notifications', {
this.$root.api('i/notifications', {
limit: max + 1,
untilId: this.notifications[this.notifications.length - 1].id
}).then(notifications => {
@@ -120,7 +120,7 @@ export default Vue.extend({
onNotification(notification) {
// TODO: ユーザーが画面を見てないと思われるとき(ブラウザやタブがアクティブじゃないなど)は送信しない
(this as any).os.stream.send('readNotification', {
this.$root.stream.send('readNotification', {
id: notification.id
});