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
+15 -2
View File
@@ -28,6 +28,7 @@ import {
LIKE_TARGET,
toggleProjectLike,
} from "../../utils/likes";
import { ensureAuthenticated } from "../../utils/authRedirect";
import {
createPlaybackSharePayload,
openShareSheet,
@@ -260,11 +261,20 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => {
imageProps={{ priority: "high" }}
/>
</Pressable>
{owner?.id && currentUID && owner.id !== currentUID && (
{owner?.id && owner.id !== currentUID && (
<Pressable
disabled={isFollowActionPending}
onPress={async () => {
if (isFollowActionPending) return;
if (
!ensureAuthenticated(currentUID, {
onIntercept: () => {
setIsFollowActionPending(false);
},
})
) {
return;
}
try {
setIsFollowActionPending(true);
@@ -327,7 +337,10 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => {
<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)));