Manav Rathi 1 year ago
parent
commit
0f64a506e5
2 changed files with 7 additions and 7 deletions
  1. 2 2
      web/apps/cast/src/pages/index.tsx
  2. 5 5
      web/apps/cast/src/services/cast.ts

+ 2 - 2
web/apps/cast/src/pages/index.tsx

@@ -39,7 +39,7 @@ export default function PairingMode() {
         try {
         try {
             const data = await getCastData(registration);
             const data = await getCastData(registration);
             if (!data) {
             if (!data) {
-                // No one has connected yet
+                // No one has connected yet.
                 return;
                 return;
             }
             }
 
 
@@ -48,7 +48,7 @@ export default function PairingMode() {
             await router.push("/slideshow");
             await router.push("/slideshow");
         } catch (e) {
         } catch (e) {
             console.log("Failed to get cast data", e);
             console.log("Failed to get cast data", e);
-            // Start again from the beginning
+            // Start again from the beginning.
             setPairingCode(undefined);
             setPairingCode(undefined);
             init();
             init();
         }
         }

+ 5 - 5
web/apps/cast/src/services/cast.ts

@@ -1,7 +1,3 @@
-// eslint has already fixed this warning, we don't have the latest version yet
-// https://github.com/eslint/eslint/pull/18286
-/* eslint-disable no-constant-condition */
-
 import log from "@/next/log";
 import log from "@/next/log";
 import { boxSealOpen, toB64 } from "@ente/shared/crypto/internal/libsodium";
 import { boxSealOpen, toB64 } from "@ente/shared/crypto/internal/libsodium";
 import castGateway from "@ente/shared/network/cast";
 import castGateway from "@ente/shared/network/cast";
@@ -86,6 +82,10 @@ export const register = async (): Promise<Registration> => {
 
 
     // Register keypair with museum to get a pairing code.
     // Register keypair with museum to get a pairing code.
     let pairingCode: string;
     let pairingCode: string;
+    // 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 */
     while (true) {
     while (true) {
         try {
         try {
             pairingCode = await castGateway.registerDevice(publicKeyB64);
             pairingCode = await castGateway.registerDevice(publicKeyB64);
@@ -143,7 +143,7 @@ export const advertiseCode = (
         incomingMessageListener as unknown as SystemEventHandler,
         incomingMessageListener as unknown as SystemEventHandler,
     );
     );
 
 
-    // Shutdown ourselves if the "sender" disconnects.
+    // Shutdown ourselves if the sender disconnects.
     // TODO(MR): Does it?
     // TODO(MR): Does it?
     context.addEventListener(
     context.addEventListener(
         cast.framework.system.EventType.SENDER_DISCONNECTED,
         cast.framework.system.EventType.SENDER_DISCONNECTED,