feat: unauthenticated tab

This commit is contained in:
2025-11-05 10:58:34 +01:00
parent 8180e0b375
commit e8db8d1654
15 changed files with 229 additions and 58 deletions
@@ -29,6 +29,7 @@ import {
LIKE_TARGET,
toggleProjectLike,
} from "../../../utils/likes";
import { ensureAuthenticated } from "../../../utils/authRedirect";
import {
createPlaybackSharePayload,
openShareSheet,
@@ -427,10 +428,19 @@ const PlaybackItem = ({
/>
)}
</Pressable>
{owner?.id && currentUID && owner.id !== currentUID && (
{owner?.id && owner.id !== currentUID && (
<Pressable
style={styles.followPressable}
onPress={async () => {
if (
!ensureAuthenticated(currentUID, {
onIntercept: () => {
setIsFollowing(false);
},
})
) {
return;
}
try {
const next = !isFollowing;
setIsFollowing(next);
@@ -465,7 +475,10 @@ const PlaybackItem = ({
<Pressable
onPress={async () => {
try {
if (!currentUID || !item?.id) return;
if (!item?.id) return;
if (!ensureAuthenticated(currentUID)) {
return;
}
const nextLiked = !isLiked;
setIsLiked(nextLiked);
setLikesCount((c) => Math.max(0, c + (nextLiked ? 1 : -1)));