hoist useprefs
This commit is contained in:
@@ -95,7 +95,7 @@ import {
|
||||
useLanguagePrefs,
|
||||
useLanguagePrefsApi,
|
||||
} from '#/state/preferences/languages'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {usePreferences} from '#/state/queries/preferences'
|
||||
import {useProfileQuery} from '#/state/queries/profile'
|
||||
import {type Gif} from '#/state/queries/tenor'
|
||||
import {useAgent, useSession} from '#/state/session'
|
||||
@@ -213,7 +213,7 @@ export const ComposePost = ({
|
||||
const {mutate: cleanupPublishedDraft} = useCleanupPublishedDraftMutation()
|
||||
const {closeAllDialogs} = useDialogStateControlContext()
|
||||
const {closeAllModals} = useModalControls()
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const preferences = usePreferences()
|
||||
const navigation = useNavigation<NavigationProp>()
|
||||
|
||||
const [isKeyboardVisible] = useIsKeyboardVisible({iosUseWillEvents: true})
|
||||
|
||||
@@ -11,7 +11,7 @@ import {isNetworkError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {usePostInteractionSettingsMutation} from '#/state/queries/post-interaction-settings'
|
||||
import {createPostgateRecord} from '#/state/queries/postgate/util'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {usePreferences} from '#/state/queries/preferences'
|
||||
import {
|
||||
type ThreadgateAllowUISetting,
|
||||
threadgateAllowUISettingToAllowRecordValue,
|
||||
@@ -65,7 +65,7 @@ export function ThreadgateBtn({
|
||||
setShowTooltip(false)
|
||||
}
|
||||
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const preferences = usePreferences()
|
||||
const [persist, setPersist] = useState(false)
|
||||
|
||||
const onPress = () => {
|
||||
|
||||
@@ -20,8 +20,8 @@ import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileFeedgensQuery} from '#/state/queries/profile-feedgens'
|
||||
import {usePreferences} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileFeedgens} from '#/state/queries/profile-feedgens'
|
||||
import {useSession} from '#/state/session'
|
||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
@@ -80,7 +80,7 @@ export function ProfileFeedgens({
|
||||
refetch,
|
||||
} = useProfileFeedgensQuery(did, opts)
|
||||
const isEmpty = !isPending && !data?.pages[0]?.feeds.length
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const preferences = usePreferences()
|
||||
const navigation = useNavigation()
|
||||
const {currentAccount} = useSession()
|
||||
const isSelf = currentAccount?.did === did
|
||||
|
||||
@@ -20,8 +20,8 @@ import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileListsQuery} from '#/state/queries/profile-lists'
|
||||
import {usePreferences} from '#/state/queries/preferences'
|
||||
import {RQKEY, useProfileListsQuerry} from '#/state/queries/profile-lists'
|
||||
import {useSession} from '#/state/session'
|
||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
@@ -80,7 +80,7 @@ export function ProfileLists({
|
||||
refetch,
|
||||
} = useProfileListsQuery(did, opts)
|
||||
const isEmpty = !isPending && !data?.pages[0]?.lists.length
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const preferences = usePreferences()
|
||||
const navigation = useNavigation()
|
||||
const {currentAccount} = useSession()
|
||||
const isSelf = currentAccount?.did === did
|
||||
|
||||
@@ -7,7 +7,7 @@ import {Trans} from '@lingui/react/macro'
|
||||
import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
import {logger} from '#/logger'
|
||||
import {
|
||||
usePreferencesQuery,
|
||||
usePreferences,
|
||||
useRemoveFeedMutation,
|
||||
useReplaceForYouWithDiscoverFeedMutation,
|
||||
} from '#/state/queries/preferences'
|
||||
@@ -23,7 +23,7 @@ export function FeedShutdownMsg({feedUri}: {feedUri: string}) {
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
const setSelectedFeed = useSetSelectedFeed()
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const preferences = usePreferences()
|
||||
const {mutateAsync: removeFeed, isPending: isRemovePending} =
|
||||
useRemoveFeedMutation()
|
||||
const {mutateAsync: replaceFeedWithDiscover, isPending: isReplacePending} =
|
||||
|
||||
@@ -88,11 +88,7 @@ let ProfileMenu = ({
|
||||
const {canGoLive} = useLiveNowConfig()
|
||||
const status = useActorStatus(profile)
|
||||
const statusNudge = useNux(Nux.LiveNowBetaNudge)
|
||||
const statusNudgeActive =
|
||||
isSelf &&
|
||||
canGoLive &&
|
||||
statusNudge.status === 'ready' &&
|
||||
!statusNudge.nux?.completed
|
||||
const statusNudgeActive = isSelf && canGoLive && !statusNudge.nux?.completed
|
||||
const {mutate: saveNux} = useSaveNux()
|
||||
|
||||
const [queueMute, queueUnmute] = useProfileMuteMutationQueue(profile)
|
||||
|
||||
Reference in New Issue
Block a user