Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Reduce

Manav Rathi3e4f88338ef5
diff --git a/web/apps/cast/src/services/cast-receiver.tsx b/web/apps/cast/src/services/cast-receiver.tsx
index 587b7672f4..3494534d7f 100644
--- a/web/apps/cast/src/services/cast-receiver.tsx
+++ b/web/apps/cast/src/services/cast-receiver.tsx
@@ -130,6 +130,7 @@ const advertiseCode = (cast: Cast) => {
// Reply with the code that we have if anyone asks over Chromecast.
const incomingMessageListener = ({ senderId, data }: ListenerProps) => {
+ // TODO (MR): shutdown
const restart = (reason: string) => {
log.error(`Restarting app: ${reason}`);
// context.stop will close the tab but it'll get reopened again
@@ -153,17 +154,18 @@ const advertiseCode = (cast: Cast) => {
? data["collectionID"]
: undefined;
- if (
- collectionID &&
- pairedCollectionID &&
- pairedCollectionID != collectionID
- ) {
- restart(`incoming request for a new collection ${collectionID}`);
+ if (collectionID && pairedCollectionID) {
+ if (pairedCollectionID != collectionID) {
+ restart(
+ `incoming request for a new collection ${collectionID}`,
+ );
+ }
return;
}
const code = castReceiver.pairingCode?.();
if (!code) {
+ if (pairedCollectionID) return;
// Our caller waits until it has a pairing code before it calls
// `advertiseCode`, but there is still an edge case where we can
// find ourselves without a pairing code:
diff --git a/web/apps/cast/src/services/render.ts b/web/apps/cast/src/services/render.ts
index 003fed9776..456c8fd589 100644
--- a/web/apps/cast/src/services/render.ts
+++ b/web/apps/cast/src/services/render.ts
@@ -91,6 +91,7 @@ export const renderableImageURLs = async function* (castData: CastData) {
urls.push(await createRenderableURL(castToken, file));
haveEligibleFiles = true;
} catch (e) {
+ // TODO (MR): Throw on token invaildation 403
log.error("Skipping unrenderable file", e);
continue;
}