fix: gate signaling behind profile setup, fix SW cache
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
This commit is contained in:
parent
e3085ea7a2
commit
d8d747276a
@ -11,6 +11,16 @@ import PublicRoomPanel from "../components/PublicRoomPanel";
|
||||
import ProfileSetup from "../components/ProfileSetup";
|
||||
|
||||
export default function Home() {
|
||||
const isSetUp = useProfileStore((s) => s.isSetUp);
|
||||
|
||||
if (!isSetUp) {
|
||||
return <ProfileSetup onDone={() => {}} />;
|
||||
}
|
||||
|
||||
return <HomeConnected />;
|
||||
}
|
||||
|
||||
function HomeConnected() {
|
||||
const { sendFiles, sendText, acceptTransfer, rejectTransfer, createPublicRoom } =
|
||||
useSignaling();
|
||||
|
||||
@ -22,7 +32,7 @@ export default function Home() {
|
||||
const setShowTextModal = useStore((s) => s.setShowTextModal);
|
||||
const setError = useStore((s) => s.setError);
|
||||
|
||||
const { deviceName, avatar, isSetUp } = useProfileStore();
|
||||
const { deviceName, avatar } = useProfileStore();
|
||||
const [showProfileEdit, setShowProfileEdit] = useState(false);
|
||||
|
||||
const handlePeerSelect = useCallback(
|
||||
@ -145,10 +155,7 @@ export default function Home() {
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{/* Profile setup — first time or edit */}
|
||||
{!isSetUp && (
|
||||
<ProfileSetup onDone={() => {}} />
|
||||
)}
|
||||
{/* Profile edit modal */}
|
||||
{showProfileEdit && (
|
||||
<ProfileSetup isEditing onDone={() => setShowProfileEdit(false)} />
|
||||
)}
|
||||
|
||||
@ -12,9 +12,19 @@ import ProfileSetup from "../components/ProfileSetup";
|
||||
|
||||
export default function JoinRoom() {
|
||||
const { code } = useParams<{ code: string }>();
|
||||
const isSetUp = useProfileStore((s) => s.isSetUp);
|
||||
|
||||
if (!isSetUp) {
|
||||
return <ProfileSetup onDone={() => {}} />;
|
||||
}
|
||||
|
||||
return <JoinRoomConnected code={code} />;
|
||||
}
|
||||
|
||||
function JoinRoomConnected({ code }: { code?: string }) {
|
||||
const { sendFiles, sendText, acceptTransfer, rejectTransfer } = useSignaling(code);
|
||||
|
||||
const { deviceName, avatar, isSetUp } = useProfileStore();
|
||||
const { deviceName, avatar } = useProfileStore();
|
||||
const [showProfileEdit, setShowProfileEdit] = useState(false);
|
||||
const selectedPeerId = useStore((s) => s.selectedPeerId);
|
||||
const showTextModal = useStore((s) => s.showTextModal);
|
||||
@ -146,10 +156,7 @@ export default function JoinRoom() {
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{/* Profile setup — first time or edit */}
|
||||
{!isSetUp && (
|
||||
<ProfileSetup onDone={() => {}} />
|
||||
)}
|
||||
{/* Profile edit modal */}
|
||||
{showProfileEdit && (
|
||||
<ProfileSetup isEditing onDone={() => setShowProfileEdit(false)} />
|
||||
)}
|
||||
|
||||
@ -15,6 +15,17 @@ export default defineConfig({
|
||||
VitePWA({
|
||||
registerType: "autoUpdate",
|
||||
includeAssets: ["favicon.svg"],
|
||||
workbox: {
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
navigateFallback: "index.html",
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: ({ request }) => request.mode === "navigate",
|
||||
handler: "NetworkFirst",
|
||||
},
|
||||
],
|
||||
},
|
||||
manifest: {
|
||||
name: "AnyDrop",
|
||||
short_name: "AnyDrop",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user