Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove overrides

Manav Rathi3fb02cf34359
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsx
index e0b6bf710f..be7f7e7921 100644
--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx
+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx
@@ -101,7 +101,15 @@ const AllAlbumsDialog = styled(Dialog)(({ theme }) => ({
},
}));
-const Title = ({
+type TitleProps = { collectionCount: number } & Pick<
+ AllAlbums,
+ | "onClose"
+ | "collectionsSortBy"
+ | "onChangeCollectionsSortBy"
+ | "isInHiddenSection"
+>;
+
+const Title: React.FC<TitleProps> = ({
onClose,
collectionCount,
collectionsSortBy,
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index 65c0aeb2bd..053e67aee9 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -145,9 +145,9 @@ export const GalleryBarAndListHeader: React.FC<
onRemotePull,
onAddSaveGroup,
}}
- collectionSummary={toShowCollectionSummaries.get(
- activeCollectionID!,
- )!}
+ collectionSummary={
+ toShowCollectionSummaries.get(activeCollectionID!)!
+ }
onCollectionShare={showCollectionShare}
onCollectionCast={showCollectionCast}
/>
@@ -211,9 +211,9 @@ export const GalleryBarAndListHeader: React.FC<
/>
<CollectionShare
{...collectionShareVisibilityProps}
- collectionSummary={toShowCollectionSummaries.get(
- activeCollectionID!,
- )!}
+ collectionSummary={
+ toShowCollectionSummaries.get(activeCollectionID!)!
+ }
collection={activeCollection}
{...{
user,
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsx
index aa05c2d6d8..e0f25a98ae 100644
--- a/web/apps/photos/src/components/FileList.tsx
+++ b/web/apps/photos/src/components/FileList.tsx
@@ -1,5 +1,4 @@
// TODO: Audit this file
-/* eslint-disable @typescript-eslint/restrict-plus-operands */
import AlbumOutlinedIcon from "@mui/icons-material/AlbumOutlined";
import FavoriteRoundedIcon from "@mui/icons-material/FavoriteRounded";
import PlayCircleOutlineOutlinedIcon from "@mui/icons-material/PlayCircleOutlineOutlined";
@@ -358,12 +357,15 @@ export const FileList: React.FC<FileListProps> = ({
});
};
- const getVacuumItem = (timeStampList, footerHeight: number) => {
+ const getVacuumItem = (
+ timeStampList: TimeStampListItem[],
+ footerHeight: number,
+ ) => {
const fileListHeight = (() => {
let sum = 0;
const getCurrentItemSize = getItemSize(timeStampList);
for (let i = 0; i < timeStampList.length; i++) {
- sum += getCurrentItemSize(i);
+ sum += getCurrentItemSize(i)!;
if (height - sum <= footerHeight) {
break;
}
@@ -456,16 +458,17 @@ export const FileList: React.FC<FileListProps> = ({
return newList;
};
- const getItemSize = (timeStampList) => (index) => {
- switch (timeStampList[index].tag) {
- case "date":
- return dateContainerHeight;
- case "file":
- return listItemHeight;
- default:
- return timeStampList[index].height;
- }
- };
+ const getItemSize =
+ (timeStampList: TimeStampListItem[]) => (index: number) => {
+ switch (timeStampList[index]!.tag) {
+ case "date":
+ return dateContainerHeight;
+ case "file":
+ return listItemHeight;
+ default:
+ return timeStampList[index]!.height!;
+ }
+ };
const generateKey = (index: number) => {
switch (timeStampList[index]!.tag) {
diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsx
index 100cd2b9b8..29a4c436ab 100644
--- a/web/apps/photos/src/components/UploadProgress.tsx
+++ b/web/apps/photos/src/components/UploadProgress.tsx
@@ -381,6 +381,7 @@ const InProgressSection: React.FC = () => {
const fileList = inProgressUploads ?? [];
+ // @ts-expect-error Need to add types
const renderListItem = ({ localFileID, progress }) => {
return (
<InProgressItemContainer key={localFileID}>
@@ -396,10 +397,12 @@ const InProgressSection: React.FC = () => {
);
};
+ // @ts-expect-error Need to add types
const getItemTitle = ({ localFileID, progress }) => {
return `${uploadFileNames.get(localFileID)} - ${progress}%`;
};
+ // @ts-expect-error Need to add types
const generateItemKey = ({ localFileID, progress }) => {
return `${localFileID}-${progress}`;
};
@@ -501,6 +504,7 @@ const ResultSection: React.FC<ResultSectionProps> = ({
return <></>;
}
+ // @ts-expect-error Need to add types
const renderListItem = (fileID) => {
return (
<ResultItemContainer key={fileID}>
@@ -509,10 +513,12 @@ const ResultSection: React.FC<ResultSectionProps> = ({
);
};
+ // @ts-expect-error Need to add types
const getItemTitle = (fileID) => {
return uploadFileNames.get(fileID)!;
};
+ // @ts-expect-error Need to add types
const generateItemKey = (fileID) => {
return fileID;
};
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index 6531ecd47d..9d7a2b4dcc 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -72,7 +72,8 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
void isLocalStorageAndIndexedDBMismatch().then((mismatch) => {
if (mismatch) {
log.error("Logging out (IndexedDB and local storage mismatch)");
- return logout();
+ logout();
+ return;
} else {
return runMigrations();
}
diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.ts
index e4d0d4e6a1..07ed999501 100644
--- a/web/apps/photos/src/services/upload-manager.ts
+++ b/web/apps/photos/src/services/upload-manager.ts
@@ -235,6 +235,7 @@ class UIService {
}
}
+// @ts-expect-error Need to add types
function convertInProgressUploadsToList(inProgressUploads) {
return [...inProgressUploads.entries()].map(
([localFileID, progress]) =>
diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.ts
index d5157febef..e5a73dde20 100644
--- a/web/apps/photos/src/utils/photoFrame/index.ts
+++ b/web/apps/photos/src/utils/photoFrame/index.ts
@@ -1,3 +1,4 @@
+// TODO: Audit this file
import type { SelectionContext } from "ente-new/photos/components/gallery";
import type { GalleryBarMode } from "ente-new/photos/components/gallery/reducer";
import type { SelectedState, SetSelectedState } from "utils/file";
@@ -10,6 +11,7 @@ export const handleSelectCreator =
userID: number | undefined,
activeCollectionID: number,
activePersonID: string | undefined,
+ // @ts-expect-error Need to add types
setRangeStart?,
) =>
({ id, ownerID }: { id: number; ownerID: number }, index?: number) =>
diff --git a/web/apps/photos/tsconfig.json b/web/apps/photos/tsconfig.json
index 4b0f70e320..6360403f00 100644
--- a/web/apps/photos/tsconfig.json
+++ b/web/apps/photos/tsconfig.json
@@ -2,11 +2,7 @@
"extends": "ente-build-config/tsconfig-next.json",
"compilerOptions": {
/* Set the base directory from which to resolve bare module names. */
- "baseUrl": "./src",
-
- /* Override tsconfig-next.json (TODO: Remove all of us) */
- "noImplicitAny": false,
- "strictNullChecks": false
+ "baseUrl": "./src"
},
"include": [
"next-env.d.ts",
diff --git a/web/packages/accounts/tsconfig.json b/web/packages/accounts/tsconfig.json
index 032194f233..15dcfedc2b 100644
--- a/web/packages/accounts/tsconfig.json
+++ b/web/packages/accounts/tsconfig.json
@@ -1,9 +1,5 @@
{
"extends": "ente-build-config/tsconfig-next.json",
- "compilerOptions": {
- /* MUI doesn't work with exactOptionalPropertyTypes yet. */
- "exactOptionalPropertyTypes": false
- },
"include": [
".",
"../base/global-electron.d.ts",