Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't open for logged out users

+14 -6
+6 -1
src/components/dialogs/nudges/TenMillion/index.tsx
··· 87 87 } 88 88 89 89 export function TenMillion() { 90 + const {hasSession} = useSession() 91 + return hasSession ? <TenMillionInner /> : null 92 + } 93 + 94 + export function TenMillionInner() { 90 95 const t = useTheme() 91 96 const lightTheme = useTheme('light') 92 97 const {_, i18n} = useLingui() ··· 96 101 const {currentAccount} = useSession() 97 102 const {isLoading: isProfileLoading, data: profile} = useProfileQuery({ 98 103 did: currentAccount!.did, 99 - }) // TODO PWI 104 + }) 100 105 const moderationOpts = useModerationOpts() 101 106 const moderation = React.useMemo(() => { 102 107 return profile && moderationOpts
+8 -5
src/components/dialogs/nudges/index.tsx
··· 1 1 import React from 'react' 2 2 3 + import {useSession} from '#/state/session' 3 4 import * as Dialog from '#/components/Dialog' 4 - 5 5 import {TenMillion} from '#/components/dialogs/nudges/TenMillion' 6 6 7 7 type Context = { ··· 12 12 13 13 const Context = React.createContext<Context>({ 14 14 // @ts-ignore 15 - controls: {} 15 + controls: {}, 16 16 }) 17 17 18 18 export function useContext() { ··· 22 22 let SHOWN = false 23 23 24 24 export function NudgeDialogs() { 25 + const {hasSession} = useSession() 25 26 const tenMillion = Dialog.useDialogControl() 26 27 27 28 const ctx = React.useMemo(() => { 28 29 return { 29 30 controls: { 30 - tenMillion 31 - } 31 + tenMillion, 32 + }, 32 33 } 33 34 }, [tenMillion]) 34 35 35 36 React.useEffect(() => { 37 + if (!hasSession) return 38 + 36 39 const t = setTimeout(() => { 37 40 if (!SHOWN) { 38 41 SHOWN = true ··· 43 46 return () => { 44 47 clearTimeout(t) 45 48 } 46 - }, [ctx]) 49 + }, [ctx, hasSession]) 47 50 48 51 return ( 49 52 <Context.Provider value={ctx}>