refs #2258 Apply filter to thread
This commit is contained in:
parent
c4395dd536
commit
968921b8fd
|
@ -5,6 +5,7 @@
|
|||
:message="message"
|
||||
:focused="message.uri + message.id === focusedId"
|
||||
:overlaid="modalOpened"
|
||||
:filters="filters"
|
||||
v-on:update="updateAncestorsToot"
|
||||
v-on:delete="deleteAncestorsToot"
|
||||
@focusNext="focusNext"
|
||||
|
@ -19,6 +20,7 @@
|
|||
:message="message"
|
||||
:focused="message.uri + message.id === focusedId"
|
||||
:overlaid="modalOpened"
|
||||
:filters="filters"
|
||||
:detailed="true"
|
||||
v-on:update="updateToot"
|
||||
v-on:delete="deleteToot"
|
||||
|
@ -34,6 +36,7 @@
|
|||
:message="message"
|
||||
:focused="message.uri + message.id === focusedId"
|
||||
:overlaid="modalOpened"
|
||||
:filters="filters"
|
||||
v-on:update="updateDescendantsToot"
|
||||
v-on:delete="deleteDescendantsToot"
|
||||
@focusNext="focusNext"
|
||||
|
@ -66,6 +69,7 @@ export default {
|
|||
descendants: state => state.descendants,
|
||||
timeline: state => state.ancestors.concat([state.message]).concat(state.descendants)
|
||||
}),
|
||||
...mapGetters('TimelineSpace/Contents/SideBar/TootDetail', ['filters']),
|
||||
...mapGetters('TimelineSpace/Modals', ['modalOpened'])
|
||||
},
|
||||
created() {
|
||||
|
@ -74,13 +78,13 @@ export default {
|
|||
mounted() {
|
||||
Event.$on('focus-sidebar', () => {
|
||||
this.focusedId = 0
|
||||
this.$nextTick(function() {
|
||||
this.$nextTick(function () {
|
||||
this.focusedId = this.timeline[0].uri + this.timeline[0].id
|
||||
})
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
message: function() {
|
||||
message: function () {
|
||||
this.load()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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 TootDetailState = {
|
||||
|
@ -136,11 +136,18 @@ const actions: ActionTree<TootDetailState, RootState> = {
|
|||
}
|
||||
}
|
||||
|
||||
const getters: GetterTree<TootDetailState, RootState> = {
|
||||
filters: (_state, _getters, rootState) => {
|
||||
return rootState.TimelineSpace.filters.filter(f => f.context.includes(FilterContext.Thread) && !f.irreversible)
|
||||
}
|
||||
}
|
||||
|
||||
const TootDetail: Module<TootDetailState, RootState> = {
|
||||
namespaced: true,
|
||||
state: state,
|
||||
mutations: mutations,
|
||||
actions: actions
|
||||
actions: actions,
|
||||
getters: getters
|
||||
}
|
||||
|
||||
export default TootDetail
|
||||
|
|
Loading…
Reference in New Issue