Bluesky app fork with some witchin' additions 💫

fix moderation preferences for non-AA'd users (#8712)

authored by hailey.at and committed by

GitHub f0b869ae 0610c822

+9 -7
+5 -5
src/state/ageAssurance/const.ts
··· 2 2 3 3 import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation' 4 4 5 - export const AGE_RESTRICTED_MODERATION_PREFS: ModerationPrefs = { 5 + export const makeAgeRestrictedModerationPrefs = ( 6 + prefs: ModerationPrefs, 7 + ): ModerationPrefs => ({ 8 + ...prefs, 6 9 adultContentEnabled: false, 7 10 labels: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES, 8 - labelers: [], 9 - mutedWords: [], 10 - hiddenPosts: [], 11 - } 11 + })
+4 -2
src/state/queries/preferences/index.ts
··· 11 11 import {getAge} from '#/lib/strings/time' 12 12 import {logger} from '#/logger' 13 13 import {useAgeAssuranceContext} from '#/state/ageAssurance' 14 - import {AGE_RESTRICTED_MODERATION_PREFS} from '#/state/ageAssurance/const' 14 + import {makeAgeRestrictedModerationPrefs} from '#/state/ageAssurance/const' 15 15 import {STALE} from '#/state/queries' 16 16 import { 17 17 DEFAULT_HOME_FEED_PREFS, ··· 77 77 (data: UsePreferencesQueryResponse) => { 78 78 const isUnderage = (data.userAge || 0) < 18 79 79 if (isUnderage || isAgeRestricted) { 80 - data.moderationPrefs = AGE_RESTRICTED_MODERATION_PREFS 80 + data.moderationPrefs = makeAgeRestrictedModerationPrefs( 81 + data.moderationPrefs, 82 + ) 81 83 } 82 84 return data 83 85 },