mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-09 16:28:45 +01:00
refs #2258 Apply filter to public timeline
This commit is contained in:
parent
914f539353
commit
c4395dd536
@ -9,6 +9,7 @@
|
||||
:message="item"
|
||||
:focused="item.uri + item.id === focusedId"
|
||||
:overlaid="modalOpened"
|
||||
:filters="filters"
|
||||
v-on:update="updateToot"
|
||||
v-on:delete="deleteToot"
|
||||
@focusNext="focusNext"
|
||||
@ -56,6 +57,7 @@ export default {
|
||||
startReload: state => state.TimelineSpace.HeaderMenu.reload,
|
||||
unreadNotification: state => state.TimelineSpace.unreadNotification
|
||||
}),
|
||||
...mapGetters('TimelineSpace/Contents/Public', ['filters']),
|
||||
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
|
||||
shortcutEnabled: function () {
|
||||
if (this.modalOpened) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import generator, { Entity } from 'megalodon'
|
||||
import { Module, MutationTree, ActionTree } from 'vuex'
|
||||
import generator, { Entity, FilterContext } from 'megalodon'
|
||||
import { Module, MutationTree, ActionTree, GetterTree } from 'vuex'
|
||||
import { RootState } from '@/store'
|
||||
|
||||
export type PublicState = {
|
||||
@ -131,11 +131,18 @@ const actions: ActionTree<PublicState, RootState> = {
|
||||
}
|
||||
}
|
||||
|
||||
const getters: GetterTree<PublicState, RootState> = {
|
||||
filters: (_state, _getters, rootState) => {
|
||||
return rootState.TimelineSpace.filters.filter(f => f.context.includes(FilterContext.Public) && !f.irreversible)
|
||||
}
|
||||
}
|
||||
|
||||
const Public: Module<PublicState, RootState> = {
|
||||
namespaced: true,
|
||||
state: state,
|
||||
mutations: mutations,
|
||||
actions: actions
|
||||
actions: actions,
|
||||
getters: getters
|
||||
}
|
||||
|
||||
export default Public
|
||||
|
Loading…
x
Reference in New Issue
Block a user