diff options
author | Eric Bailey <git@esb.lol> | 2024-10-10 12:04:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 10:04:23 -0700 |
commit | 3b44ea203c253302fe364d627f5ee859a9ded9e7 (patch) | |
tree | fa64706b1937fb163f0718bd7c19de633b7d3905 /src | |
parent | 96cc31babcbc53a38772fb9c9563e32ac0d6f460 (diff) | |
download | voidsky-3b44ea203c253302fe364d627f5ee859a9ded9e7.tar.zst |
Invert non config filtering (#5674)
* Invert filtering logic * Rename * Rm comment
Diffstat (limited to 'src')
-rw-r--r-- | src/components/ReportDialog/index.tsx | 2 | ||||
-rw-r--r-- | src/screens/Moderation/index.tsx | 2 | ||||
-rw-r--r-- | src/state/queries/preferences/moderation.ts | 13 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/components/ReportDialog/index.tsx b/src/components/ReportDialog/index.tsx index 5bf8aa5b4..4402152ab 100644 --- a/src/components/ReportDialog/index.tsx +++ b/src/components/ReportDialog/index.tsx @@ -35,7 +35,7 @@ function ReportDialogInner(props: ReportDialogProps) { isLoading: isLabelerLoading, data: labelers, error, - } = useMyLabelersQuery() + } = useMyLabelersQuery({excludeNonConfigurableLabelers: true}) const isLoading = useDelayedLoading(500, isLabelerLoading) const ref = React.useRef<ScrollView>(null) diff --git a/src/screens/Moderation/index.tsx b/src/screens/Moderation/index.tsx index 3b997009b..070b87950 100644 --- a/src/screens/Moderation/index.tsx +++ b/src/screens/Moderation/index.tsx @@ -169,7 +169,7 @@ export function ModerationScreenInner({ isLoading: isLabelersLoading, data: labelers, error: labelersError, - } = useMyLabelersQuery({includeNonConfigurable: true}) + } = useMyLabelersQuery() useFocusEffect( React.useCallback(() => { diff --git a/src/state/queries/preferences/moderation.ts b/src/state/queries/preferences/moderation.ts index bd92a7971..1b4de8bf2 100644 --- a/src/state/queries/preferences/moderation.ts +++ b/src/state/queries/preferences/moderation.ts @@ -18,9 +18,9 @@ export const DEFAULT_LOGGED_OUT_LABEL_PREFERENCES: typeof DEFAULT_LABEL_SETTINGS ) export function useMyLabelersQuery({ - includeNonConfigurable = false, + excludeNonConfigurableLabelers = false, }: { - includeNonConfigurable?: boolean + excludeNonConfigurableLabelers?: boolean } = {}) { const prefs = usePreferencesQuery() let dids = Array.from( @@ -30,14 +30,9 @@ export function useMyLabelersQuery({ ), ), ) - - /* - * By default, remove non-configurable moderation authorities - */ - if (!includeNonConfigurable) { + if (excludeNonConfigurableLabelers) { dids = dids.filter(did => !isNonConfigurableModerationAuthority(did)) } - const labelers = useLabelersDetailedInfoQuery({dids}) const isLoading = prefs.isLoading || labelers.isLoading const error = prefs.error || labelers.error @@ -51,7 +46,7 @@ export function useMyLabelersQuery({ } export function useLabelDefinitionsQuery() { - const labelers = useMyLabelersQuery({includeNonConfigurable: true}) + const labelers = useMyLabelersQuery() return React.useMemo(() => { return { labelDefs: Object.fromEntries( |