From be194b8a3f2d181df62a429686f24d62631e9394 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 20 Oct 2021 04:22:19 -0600 Subject: [PATCH] Update Timeline component, apply block/mute filters client side for local and network timelines --- resources/assets/js/components/Timeline.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 03bee79f8..6745a3d3b 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -508,7 +508,8 @@ recentFeedMin: null, recentFeedMax: null, reactionBar: true, - emptyFeed: false + emptyFeed: false, + filters: [] } }, @@ -567,7 +568,16 @@ break; } } - this.fetchTimelineApi(); + + if(this.scope != 'home') { + axios.get('/api/pixelfed/v2/filters') + .then(res => { + this.filters = res.data; + this.fetchTimelineApi(); + }); + } else { + this.fetchTimelineApi(); + } }); }, @@ -629,6 +639,12 @@ return; } + if(this.filters.length) { + data = data.filter(d => { + return this.filters.includes(d.account.id) == false; + }); + } + this.feed.push(...data); let ids = data.map(status => status.id); this.ids = ids;