[Chat] Gate group chats for under-18 users (#10548)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
|
||||
import {DEFAULT_LABEL_SETTINGS} from '@atproto/api'
|
||||
|
||||
import {
|
||||
type ThreadViewPreferences,
|
||||
type UsePreferencesQueryResponse,
|
||||
} from '#/state/queries/preferences/types'
|
||||
|
||||
/**
|
||||
* More strict than our default settings for logged in users.
|
||||
*
|
||||
* Defined here rather than in `./moderation` to avoid a module-init cycle:
|
||||
* `moderation` imports `./index`, which re-exports this file, so reading the
|
||||
* value from `moderation` at init time lands in its temporal dead zone.
|
||||
*/
|
||||
export const DEFAULT_LOGGED_OUT_LABEL_PREFERENCES: typeof DEFAULT_LABEL_SETTINGS =
|
||||
Object.fromEntries(
|
||||
Object.entries(DEFAULT_LABEL_SETTINGS).map(([key, _pref]) => [key, 'hide']),
|
||||
)
|
||||
|
||||
export const DEFAULT_HOME_FEED_PREFS: UsePreferencesQueryResponse['feedViewPrefs'] =
|
||||
{
|
||||
hideReplies: false,
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
import {useMemo} from 'react'
|
||||
import {
|
||||
BskyAgent,
|
||||
DEFAULT_LABEL_SETTINGS,
|
||||
interpretLabelValueDefinitions,
|
||||
} from '@atproto/api'
|
||||
import {BskyAgent, interpretLabelValueDefinitions} from '@atproto/api'
|
||||
|
||||
import {isNonConfigurableModerationAuthority} from '#/state/session/additional-moderation-authorities'
|
||||
import {useLabelersDetailedInfoQuery} from '../labeler'
|
||||
import {usePreferencesQuery} from './index'
|
||||
|
||||
/**
|
||||
* More strict than our default settings for logged in users.
|
||||
*/
|
||||
export const DEFAULT_LOGGED_OUT_LABEL_PREFERENCES: typeof DEFAULT_LABEL_SETTINGS =
|
||||
Object.fromEntries(
|
||||
Object.entries(DEFAULT_LABEL_SETTINGS).map(([key, _pref]) => [key, 'hide']),
|
||||
)
|
||||
|
||||
export function useMyLabelersQuery({
|
||||
excludeNonConfigurableLabelers = false,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user