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 show warning when sharing your own post in PWI opt-out mode (#4495)

authored by

Hailey and committed by
GitHub
99078bbf 4e4a7bf1

+15 -7
+5 -2
src/view/com/profile/ProfileMenu.tsx
··· 71 71 const loggedOutWarningPromptControl = Prompt.usePromptControl() 72 72 73 73 const showLoggedOutWarning = React.useMemo(() => { 74 - return !!profile.labels?.find(label => label.val === '!no-unauthenticated') 75 - }, [profile.labels]) 74 + return ( 75 + profile.did !== currentAccount?.did && 76 + !!profile.labels?.find(label => label.val === '!no-unauthenticated') 77 + ) 78 + }, [currentAccount, profile]) 76 79 77 80 const invalidateProfileQuery = React.useCallback(() => { 78 81 queryClient.invalidateQueries({
+4 -1
src/view/com/util/forms/PostDropdownBtn.tsx
··· 196 196 ) 197 197 }, [postAuthor]) 198 198 199 + const showLoggedOutWarning = 200 + postAuthor.did !== currentAccount?.did && hideInPWI 201 + 199 202 const onSharePost = React.useCallback(() => { 200 203 const url = toShareUrl(href) 201 204 shareUrl(url) ··· 296 299 testID="postDropdownShareBtn" 297 300 label={isWeb ? _(msg`Copy link to post`) : _(msg`Share`)} 298 301 onPress={() => { 299 - if (hideInPWI) { 302 + if (showLoggedOutWarning) { 300 303 loggedOutWarningPromptControl.open() 301 304 } else { 302 305 onSharePost()
+6 -4
src/view/com/util/post-ctrls/PostCtrls.tsx
··· 27 27 usePostLikeMutationQueue, 28 28 usePostRepostMutationQueue, 29 29 } from '#/state/queries/post' 30 - import {useRequireAuth} from '#/state/session' 30 + import {useRequireAuth, useSession} from '#/state/session' 31 31 import {useComposerControls} from '#/state/shell/composer' 32 32 import {atoms as a, useTheme} from '#/alf' 33 33 import {useDialogControl} from '#/components/Dialog' ··· 64 64 const t = useTheme() 65 65 const {_} = useLingui() 66 66 const {openComposer} = useComposerControls() 67 + const {currentAccount} = useSession() 67 68 const [queueLike, queueUnlike] = usePostLikeMutationQueue(post, logContext) 68 69 const [queueRepost, queueUnrepost] = usePostRepostMutationQueue( 69 70 post, ··· 75 76 const playHaptic = useHaptics() 76 77 77 78 const shouldShowLoggedOutWarning = React.useMemo(() => { 78 - return !!post.author.labels?.find( 79 - label => label.val === '!no-unauthenticated', 79 + return ( 80 + post.author.did !== currentAccount?.did && 81 + !!post.author.labels?.find(label => label.val === '!no-unauthenticated') 80 82 ) 81 - }, [post]) 83 + }, [currentAccount, post]) 82 84 83 85 const defaultCtrlColor = React.useMemo( 84 86 () => ({