Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix lints

Manav Rathic6110087d98a
diff --git a/web/apps/cast/src/services/cast-data.ts b/web/apps/cast/src/services/cast-data.ts
index b429eee72e..96df8a7fa6 100644
--- a/web/apps/cast/src/services/cast-data.ts
+++ b/web/apps/cast/src/services/cast-data.ts
@@ -20,7 +20,9 @@ export const storeCastData = (payload: unknown) => {
// localStorage. We don't validate here, we'll validate when we read these
// values back in `readCastData`.
for (const [key, value] of Object.entries(payload)) {
- window.localStorage.setItem(key, value);
+ typeof value == "string"
+ ? localStorage.setItem(key, value)
+ : localStorage.removeItem(key);
}
};
diff --git a/web/apps/cast/src/services/chromecast.ts b/web/apps/cast/src/services/chromecast.ts
index 77aa54aec1..b4d79e6f69 100644
--- a/web/apps/cast/src/services/chromecast.ts
+++ b/web/apps/cast/src/services/chromecast.ts
@@ -127,10 +127,10 @@ const advertiseCode = (cast: Cast) => {
// cast running on their big screen.
options.disableIdleTimeout = true;
- type ListenerProps = {
+ interface ListenerProps {
senderId: string;
data: unknown;
- };
+ }
// Reply with the code that we have if anyone asks over Chromecast.
const incomingMessageListener = ({ senderId, data }: ListenerProps) => {
@@ -142,8 +142,8 @@ const advertiseCode = (cast: Cast) => {
data &&
typeof data == "object" &&
"collectionID" in data &&
- typeof data["collectionID"] == "string"
- ? data["collectionID"]
+ typeof data.collectionID == "string"
+ ? data.collectionID
: undefined;
// If the request does not have a collectionID (or if we're not showing