π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Reorder
Manav Rathi882af5050702
diff --git a/web/apps/cast/src/pages/index.tsx b/web/apps/cast/src/pages/index.tsxindex f1ec1a7468..dd0389949e 100644--- a/web/apps/cast/src/pages/index.tsx+++ b/web/apps/cast/src/pages/index.tsx@@ -14,6 +14,10 @@ export default function Index() {const router = useRouter();+ useEffect(() => {+ init();+ }, []);+const init = () => {register().then((r) => {setPublicKeyB64(r.publicKeyB64);@@ -22,16 +26,19 @@ export default function Index() {});};- useEffect(() => {- init();- }, []);-useEffect(() => {castReceiverLoadingIfNeeded().then((cast) =>advertiseCode(cast, () => pairingCode),);}, []);+ useEffect(() => {+ if (!publicKeyB64 || !privateKeyB64 || !pairingCode) return;++ const interval = setInterval(pollTick, 2000);+ return () => clearInterval(interval);+ }, [publicKeyB64, privateKeyB64, pairingCode]);+const pollTick = async () => {const registration = { publicKeyB64, privateKeyB64, pairingCode };try {@@ -52,13 +59,6 @@ export default function Index() {}};- useEffect(() => {- if (!publicKeyB64 || !privateKeyB64 || !pairingCode) return;-- const interval = setInterval(pollTick, 2000);- return () => clearInterval(interval);- }, [publicKeyB64, privateKeyB64, pairingCode]);-return (<><div