about summary refs log tree commit diff
path: root/src/state/queries/preferences
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-10-10 12:04:23 -0500
committerGitHub <noreply@github.com>2024-10-10 10:04:23 -0700
commit3b44ea203c253302fe364d627f5ee859a9ded9e7 (patch)
treefa64706b1937fb163f0718bd7c19de633b7d3905 /src/state/queries/preferences
parent96cc31babcbc53a38772fb9c9563e32ac0d6f460 (diff)
downloadvoidsky-3b44ea203c253302fe364d627f5ee859a9ded9e7.tar.zst
Invert non config filtering (#5674)
* Invert filtering logic

* Rename

* Rm comment
Diffstat (limited to 'src/state/queries/preferences')
-rw-r--r--src/state/queries/preferences/moderation.ts13
1 files changed, 4 insertions, 9 deletions
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(