diff options
Diffstat (limited to 'src/view/com/util/post-ctrls/PostCtrls.tsx')
-rw-r--r-- | src/view/com/util/post-ctrls/PostCtrls.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx index 120aecf45..e548c45f7 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -25,6 +25,7 @@ import { } from '#/state/queries/post' import {useComposerControls} from '#/state/shell/composer' import {Shadow} from '#/state/cache/types' +import {useRequireAuth} from '#/state/session' export function PostCtrls({ big, @@ -46,6 +47,7 @@ export function PostCtrls({ const postUnlikeMutation = usePostUnlikeMutation() const postRepostMutation = usePostRepostMutation() const postUnrepostMutation = usePostUnrepostMutation() + const requireAuth = useRequireAuth() const defaultCtrlColor = React.useMemo( () => ({ @@ -107,7 +109,9 @@ export function PostCtrls({ <TouchableOpacity testID="replyBtn" style={[styles.ctrl, !big && styles.ctrlPad, {paddingLeft: 0}]} - onPress={onPressReply} + onPress={() => { + requireAuth(() => onPressReply()) + }} accessibilityRole="button" accessibilityLabel={`Reply (${post.replyCount} ${ post.replyCount === 1 ? 'reply' : 'replies' @@ -135,7 +139,9 @@ export function PostCtrls({ <TouchableOpacity testID="likeBtn" style={[styles.ctrl, !big && styles.ctrlPad]} - onPress={onPressToggleLike} + onPress={() => { + requireAuth(() => onPressToggleLike()) + }} accessibilityRole="button" accessibilityLabel={`${post.viewer?.like ? 'Unlike' : 'Like'} (${ post.likeCount |