mrf transparency panel: refactor to use vuex mapState

This commit is contained in:
Ariadne Conill 2019-11-09 11:32:18 -06:00
parent 6d6b5f3dbb
commit c24f95b498

View file

@ -1,30 +1,16 @@
import { mapState } from 'vuex'
const MRFTransparencyPanel = {
computed: {
federationPolicy () {
return this.$store.state.instance.federationPolicy
},
mrfPolicies () {
return this.$store.state.instance.federationPolicy.mrf_policies
},
acceptInstances () {
return this.$store.state.instance.federationPolicy.mrf_simple.accept
},
rejectInstances () {
return this.$store.state.instance.federationPolicy.mrf_simple.reject
},
quarantineInstances () {
return this.$store.state.instance.federationPolicy.quarantined_instances
},
ftlRemovalInstances () {
return this.$store.state.instance.federationPolicy.mrf_simple.federated_timeline_removal
},
mediaNsfwInstances () {
return this.$store.state.instance.federationPolicy.mrf_simple.media_nsfw
},
mediaRemovalInstances () {
return this.$store.state.instance.federationPolicy.mrf_simple.media_removal
}
}
computed: mapState({
federationPolicy: state => state.instance.federationPolicy,
mrfPolicies: state => state.instance.federationPolicy.mrf_policies,
acceptInstances: state => state.instance.federationPolicy.mrf_simple.accept,
rejectInstances: state => state.instance.federationPolicy.mrf_simple.reject,
quarantineInstances: state => state.instance.federationPolicy.quarantined_instances,
ftlRemovalInstances: state => state.instance.federationPolicy.mrf_simple.federated_timeline_removal,
mediaNsfwInstances: state => state.instance.federationPolicy.mrf_simple.media_nsfw,
mediaRemovalInstances: state => state.instance.federationPolicy.mrf_simple.media_removal
})
}
export default MRFTransparencyPanel