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
1 changed files with 12 additions and 26 deletions

View File

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