From 22049b10ff55da7adc37ba7caaf3d4b722b2f0b5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 29 Dec 2020 11:33:21 +0900 Subject: [PATCH] Improve timeline page --- src/client/components/timeline.vue | 16 +++ src/client/pages/timeline.vue | 185 ++++++++++++++++------------- src/client/ui/_common_/header.vue | 32 +---- 3 files changed, 125 insertions(+), 108 deletions(-) diff --git a/src/client/components/timeline.vue b/src/client/components/timeline.vue index 33e725632..9a3d3232c 100644 --- a/src/client/components/timeline.vue +++ b/src/client/components/timeline.vue @@ -115,6 +115,22 @@ export default defineComponent({ endpoint = 'notes/global-timeline'; this.connection = os.stream.useSharedConnection('globalTimeline'); this.connection.on('note', prepend); + } else if (this.src == 'mentions') { + endpoint = 'notes/mentions'; + this.connection = os.stream.useSharedConnection('main'); + this.connection.on('mention', prepend); + } else if (this.src == 'directs') { + endpoint = 'notes/mentions'; + this.query = { + visibility: 'specified' + }; + const onNote = note => { + if (note.visibility == 'specified') { + prepend(note); + } + }; + this.connection = os.stream.useSharedConnection('main'); + this.connection.on('mention', onNote); } else if (this.src == 'list') { endpoint = 'notes/user-list-timeline'; this.query = { diff --git a/src/client/pages/timeline.vue b/src/client/pages/timeline.vue index a5dd097b3..f9afdd51a 100644 --- a/src/client/pages/timeline.vue +++ b/src/client/pages/timeline.vue @@ -1,10 +1,26 @@