Skip to content

armgit / ente

Public Imported from GitHub
0

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

Cleanup

Manav Rathi6f15b4178b2b
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index ae6f126397..d7cddb8291 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -162,7 +162,7 @@ export const GalleryBarAndListHeader: React.FC<
),
height: 68,
});
- // eslint-disable-next-line react-hooks/exhaustive-deps
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
shouldHide,
mode,
diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsx
index ab08d4c27c..0e8a35656b 100644
--- a/web/apps/photos/src/components/FileListWithViewer.tsx
+++ b/web/apps/photos/src/components/FileListWithViewer.tsx
@@ -134,11 +134,14 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({
[files],
);
- const handleThumbnailClick = useCallback((index: number) => {
- setCurrentIndex(index);
- setOpenFileViewer(true);
- onSetOpenFileViewer?.(true);
- }, [onSetOpenFileViewer]);
+ const handleThumbnailClick = useCallback(
+ (index: number) => {
+ setCurrentIndex(index);
+ setOpenFileViewer(true);
+ onSetOpenFileViewer?.(true);
+ },
+ [onSetOpenFileViewer],
+ );
const handleCloseFileViewer = useCallback(() => {
onSetOpenFileViewer?.(false);
diff --git a/web/packages/accounts/services/session.ts b/web/packages/accounts/services/session.ts
index c2e6f76f35..7d5eeeb22c 100644
--- a/web/packages/accounts/services/session.ts
+++ b/web/packages/accounts/services/session.ts
@@ -117,10 +117,7 @@ export const checkSessionValidity = async (): Promise<SessionValidity> => {
// changed.
return {
status: "validButPasswordChanged",
- // TODO:
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- updatedKeyAttributes: remoteKeyAttributes as KeyAttributes,
+ updatedKeyAttributes: remoteKeyAttributes,
updatedSRPAttributes: remoteSRPAttributes,
};
}
diff --git a/web/packages/gallery/services/video.ts b/web/packages/gallery/services/video.ts
index 68e129099b..61561ffc72 100644
--- a/web/packages/gallery/services/video.ts
+++ b/web/packages/gallery/services/video.ts
@@ -349,14 +349,7 @@ export const hlsPlaylistDataForFile = async (
playlist: playlistTemplate,
width,
height,
- } = await decryptPlaylistJSON(
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- playlistFileData,
- file,
- );
+ } = await decryptPlaylistJSON(playlistFileData, file);
// A playlist format the current client does not understand.
if (type != "hls_video") return undefined;
diff --git a/web/packages/media/collection.ts b/web/packages/media/collection.ts
index 81d90909e6..b8412a6d65 100644
--- a/web/packages/media/collection.ts
+++ b/web/packages/media/collection.ts
@@ -529,13 +529,7 @@ export const decryptRemoteCollection = async (
owner: parseRemoteCollectionUser(owner),
name,
sharees: sharees.map(parseRemoteCollectionUser),
- // TODO:
- //
- // See: [Note: strict mode migration]
- //
- // We need to add the cast here, otherwise we get a tsc error when this
- // file is imported in the photos app.
- publicURLs: rest.publicURLs as PublicURL[],
+ publicURLs: rest.publicURLs,
magicMetadata,
pubMagicMetadata,
sharedMagicMetadata,
diff --git a/web/packages/media/file.ts b/web/packages/media/file.ts
index 12ab7bbed4..9ede63ab24 100644
--- a/web/packages/media/file.ts
+++ b/web/packages/media/file.ts
@@ -381,10 +381,6 @@ export const decryptRemoteFile = async (
collectionKey,
);
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
const metadataJSON = await decryptMetadataJSON(encryptedMetadata, key);
const metadata = FileMetadata.parse(
transformDecryptedMetadataJSON(id, metadataJSON),
diff --git a/web/packages/new/albums/services/public-albums-fdb.ts b/web/packages/new/albums/services/public-albums-fdb.ts
index 5e940ced6a..429a294901 100644
--- a/web/packages/new/albums/services/public-albums-fdb.ts
+++ b/web/packages/new/albums/services/public-albums-fdb.ts
@@ -20,15 +20,9 @@ import { z } from "zod/v4";
* Use {@link savePublicCollections} to update the database.
*/
const savedPublicCollections = async (): Promise<Collection[]> =>
- // TODO:
- //
- // See: [Note: strict mode migration]
- //
- // We need to add the cast here, otherwise we get a tsc error when this
- // file is imported in the photos app.
LocalCollections.parse(
(await localForage.getItem("public-collections")) ?? [],
- ) as Collection[];
+ );
/**
* Replace the list of public collections stored in our local database.
diff --git a/web/packages/new/photos/services/collection.ts b/web/packages/new/photos/services/collection.ts
index 6eeb0b1b5a..f231c64f70 100644
--- a/web/packages/new/photos/services/collection.ts
+++ b/web/packages/new/photos/services/collection.ts
@@ -1390,10 +1390,6 @@ export const createPublicURL = async (
body: JSON.stringify({ collectionID, ...attributes }),
});
ensureOk(res);
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
return z.object({ result: RemotePublicURL }).parse(await res.json()).result;
};
@@ -1429,10 +1425,6 @@ export const updatePublicURL = async (
body: JSON.stringify({ collectionID, ...updates }),
});
ensureOk(res);
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
return z.object({ result: RemotePublicURL }).parse(await res.json()).result;
};
diff --git a/web/packages/new/photos/services/ml/ml-data.ts b/web/packages/new/photos/services/ml/ml-data.ts
index 28271ec65e..370e4002f9 100644
--- a/web/packages/new/photos/services/ml/ml-data.ts
+++ b/web/packages/new/photos/services/ml/ml-data.ts
@@ -171,10 +171,6 @@ export const fetchMLData = async (
try {
const decryptedBytes = await decryptBlobBytes(
remoteFileData,
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
file.key,
);
const jsonString = await gunzip(decryptedBytes);
@@ -199,14 +195,6 @@ const remoteMLDataFromJSONString = (
) => {
const raw = RawRemoteMLData.parse(JSON.parse(jsonString));
const parseResult = ParsedRemoteMLData.safeParse(raw);
- // TODO: [Note: strict mode migration]
- //
- // This code is included in apps/photos where it causes spurious tsc failure
- // since the photos app currently does not have the TypeScript strict mode
- // enabled (unlike the current file).
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
const parsed = parseResult.success
? (parseResult.data as ParsedRemoteMLData)
: undefined;
diff --git a/web/packages/new/photos/services/photos-fdb.ts b/web/packages/new/photos/services/photos-fdb.ts
index 357a30d909..a02b21a0a3 100644
--- a/web/packages/new/photos/services/photos-fdb.ts
+++ b/web/packages/new/photos/services/photos-fdb.ts
@@ -22,15 +22,7 @@ import type { TrashItem } from "./trash";
* Use {@link saveCollections} to update the database.
*/
export const savedCollections = async (): Promise<Collection[]> =>
- // TODO:
- //
- // See: [Note: strict mode migration]
- //
- // We need to add the cast here, otherwise we get a tsc error when this
- // file is imported in the photos app.
- LocalCollections.parse(
- (await localForage.getItem("collections")) ?? [],
- ) as Collection[];
+ LocalCollections.parse((await localForage.getItem("collections")) ?? []);
/**
* Replace the list of collections stored in our local database.
diff --git a/web/packages/new/photos/services/search/worker.ts b/web/packages/new/photos/services/search/worker.ts
index b088eef50f..8a3bee99cb 100644
--- a/web/packages/new/photos/services/search/worker.ts
+++ b/web/packages/new/photos/services/search/worker.ts
@@ -431,10 +431,6 @@ const defaultCityRadius = 10;
const kmsPerDegree = 111.16;
const isInsideLocationTag = (location: Location, locationTag: LocationTag) =>
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
isWithinRadius(location, locationTag.centerPoint, locationTag.radius);
const isInsideCity = (location: Location, city: City) =>
diff --git a/web/packages/new/photos/services/user-entity/db.ts b/web/packages/new/photos/services/user-entity/db.ts
index bc3e870c04..f9fa86ce39 100644
--- a/web/packages/new/photos/services/user-entity/db.ts
+++ b/web/packages/new/photos/services/user-entity/db.ts
@@ -53,10 +53,6 @@ export const saveEntities = (type: EntityType, items: LocalUserEntity[]) =>
export const savedEntities = async (
type: EntityType,
): Promise<LocalUserEntity[]> =>
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
LocalUserEntity.array().parse((await getKV(entitiesKey(type))) ?? []);
/**
diff --git a/web/packages/new/photos/services/user-entity/index.ts b/web/packages/new/photos/services/user-entity/index.ts
index ca9f50ac27..dd4de714fa 100644
--- a/web/packages/new/photos/services/user-entity/index.ts
+++ b/web/packages/new/photos/services/user-entity/index.ts
@@ -102,10 +102,6 @@ export type CGroup = Omit<LocalUserEntity, "data"> & {
* Return the list of locally available cgroup user entities.
*/
export const savedCGroups = (): Promise<CGroup[]> =>
- // See: [Note: strict mode migration]
- //
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
savedEntities("cgroup").then((es) =>
es.map((e) => ({ ...e, data: RemoteCGroupData.parse(e.data) })),
);