diff --git a/js/app/src/router.tsx b/js/app/src/router.tsx index 743d1afbb..69c150318 100644 --- a/js/app/src/router.tsx +++ b/js/app/src/router.tsx @@ -275,6 +275,7 @@ export const UploadButton = () => { const isCompact = windowWidth <= 800; const { status: betaStatus, loading: betaLoading } = useBetaStatus("vod"); + const navigation = useNavigation(); if (!did) return null; if (betaLoading) return null; @@ -294,7 +295,13 @@ export const UploadButton = () => { to={{ screen: "HomeTab", params: { screen: "Upload" } }} style={{ marginRight: 10 }} > - @@ -317,7 +324,13 @@ export const UploadButton = () => { to={{ screen: "HomeTab", params: { screen: "Upload" } }} style={{ marginRight: 10 }} > - diff --git a/js/app/src/screens/upload.tsx b/js/app/src/screens/upload.tsx index ba8aae3d4..70e196a89 100644 --- a/js/app/src/screens/upload.tsx +++ b/js/app/src/screens/upload.tsx @@ -1,3 +1,4 @@ +import { useRoute } from "@react-navigation/native"; import { Admonition, Button, @@ -40,6 +41,8 @@ import { TextInput, useWindowDimensions, } from "react-native"; +import { useStore } from "store"; +import { useIsReady, useUserProfile } from "store/hooks"; import type { PlaceStreamLivestream, PlaceStreamVideo } from "streamplace"; import * as tus from "tus-js-client"; @@ -106,6 +109,10 @@ const BETA_FEATURE = "vod"; export default function UploadScreen() { const agent = usePDSAgent(); + const isReady = useIsReady(); + const userProfile = useUserProfile(); + const openLoginModal = useStore((state) => state.openLoginModal); + const route = useRoute(); const { status: betaStatus, loading: betaLoading, @@ -595,6 +602,48 @@ export default function UploadScreen() { // ── render ──────────────────────────────────────────────────────────────── + // Login gate: uploading needs an account. Wait for auth to resolve, then + // prompt logged-out users with a login button that returns them here. + if (!isReady) { + return ; + } + if (!userProfile) { + return ( + + + + Log in to upload videos + + + You need to be logged in to upload and manage your videos. + + + + + ); + } + // Beta gate: hold the upload UI until we know the account's access status. // While we're still resolving it for a logged-in user, show a spinner; if // they're not granted, swap the whole page for the request-access flow.