diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index 20f8a08a..6a1baec8 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -1,16 +1,27 @@ import { mapState } from 'vuex' +import { get } from 'lodash' const MRFTransparencyPanel = { - 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 - }) + computed: { + ...mapState({ + federationPolicy: state => get(state, 'instance.federationPolicy'), + mrfPolicies: state => get(state, 'instance.federationPolicy.mrf_policies', []), + quarantineInstances: state => get(state, 'instance.federationPolicy.quarantined_instances', []), + acceptInstances: state => get(state, 'instance.federationPolicy.mrf_simple.accept', []), + rejectInstances: state => get(state, 'instance.federationPolicy.mrf_simple.reject', []), + ftlRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []), + mediaNsfwInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []), + mediaRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_removal', []) + }), + hasInstanceSpecificPolicies () { + return this.quarantineInstances.length || + this.acceptInstances.length || + this.rejectInstances.length || + this.ftlRemovalInstances.length || + this.mediaNsfwInstances.length || + this.mediaRemovalInstances.length + } + } } export default MRFTransparencyPanel diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue index 2640d68c..d6495dc6 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue @@ -22,7 +22,9 @@ /> -

{{ $t("about.mrf_policy_simple") }}

+

+ {{ $t("about.mrf_policy_simple") }} +

{{ $t("about.mrf_policy_simple_accept") }}