π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix lints
Manav Rathiface4bb55b37
diff --git a/web/apps/cast/src/components/FilledCircleCheck.tsx b/web/apps/cast/src/components/FilledCircleCheck.tsxindex ba2292922e..86d1b41a0a 100644--- a/web/apps/cast/src/components/FilledCircleCheck.tsx+++ b/web/apps/cast/src/components/FilledCircleCheck.tsx@@ -1,4 +1,5 @@import { styled } from "@mui/material";+import React from "react";export const FilledCircleCheck: React.FC = () => {return (diff --git a/web/apps/cast/src/components/PairingCode.tsx b/web/apps/cast/src/components/PairingCode.tsxindex fa1474bafc..89f91fab8a 100644--- a/web/apps/cast/src/components/PairingCode.tsx+++ b/web/apps/cast/src/components/PairingCode.tsx@@ -1,4 +1,5 @@import { styled } from "@mui/material";+import React from "react";const colors = ["#87CEFA", // Light Bluediff --git a/web/apps/cast/src/pages/index.tsx b/web/apps/cast/src/pages/index.tsxindex ed10d14ae2..f48a21b6ce 100644--- a/web/apps/cast/src/pages/index.tsx+++ b/web/apps/cast/src/pages/index.tsx@@ -33,32 +33,32 @@ export default function Index() {useEffect(() => {if (!publicKeyB64 || !privateKeyB64 || !pairingCode) return;- const interval = setInterval(pollTick, 2000);- return () => clearInterval(interval);- }, [publicKeyB64, privateKeyB64, pairingCode]);-- const pollTick = async () => {- if (!publicKeyB64 || !privateKeyB64 || !pairingCode) return;+ const pollTick = async () => {+ const registration = { publicKeyB64, privateKeyB64, pairingCode };+ try {+ // TODO:+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ const data = await getCastData(registration);+ if (!data) {+ // No one has connected yet.+ return;+ }- const registration = { publicKeyB64, privateKeyB64, pairingCode };- try {- const data = await getCastData(registration);- if (!data) {- // No one has connected yet.- return;+ storeCastData(data);+ await router.push("/slideshow");+ } catch (e) {+ // The pairing code becomes invalid after an hour, which will cause+ // `getCastData` to fail. There might be other reasons this might+ // fail too, but in all such cases, it is a reasonable idea to start+ // again from the beginning.+ log.warn("Failed to get cast data", e);+ setPairingCode(undefined);}+ };- storeCastData(data);- await router.push("/slideshow");- } catch (e) {- // The pairing code becomes invalid after an hour, which will cause- // `getCastData` to fail. There might be other reasons this might- // fail too, but in all such cases, it is a reasonable idea to start- // again from the beginning.- log.warn("Failed to get cast data", e);- setPairingCode(undefined);- }- };+ const interval = setInterval(() => pollTick, 2000);+ return () => clearInterval(interval);+ }, [publicKeyB64, privateKeyB64, pairingCode, router]);return (<Container>diff --git a/web/apps/cast/src/services/pair.ts b/web/apps/cast/src/services/pair.tsindex bc50f19b59..1c0124595b 100644--- a/web/apps/cast/src/services/pair.ts+++ b/web/apps/cast/src/services/pair.ts@@ -82,10 +82,11 @@ export const register = async (): Promise<Registration> => {// Register keypair with museum to get a pairing code.let pairingCode: string | undefined;- // eslint has fixed this spurious warning, but we're not on the latest+ // TODO: eslint has fixed this spurious warning, but we're not on the latest// version yet, so add a disable.// https://github.com/eslint/eslint/pull/18286/* eslint-disable no-constant-condition */+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-conditionwhile (true) {try {pairingCode = await castGateway.registerDevice(publicKeyB64);@@ -126,5 +127,7 @@ export const getCastData = async (registration: Registration) => {privateKeyB64,);+ // TODO:+ // eslint-disable-next-line @typescript-eslint/no-unsafe-returnreturn JSON.parse(atob(decryptedCastData));};