π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
More lints and tsc
Manav Rathi6ae0516bd777
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjsindex b8709f6cd3..76d9b9a84c 100644--- a/web/apps/photos/eslint.config.mjs+++ b/web/apps/photos/eslint.config.mjs@@ -20,9 +20,7 @@ export default [/** TODO: Disabled as we migrate, try to prune these again */"@typescript-eslint/no-floating-promises": "off","@typescript-eslint/no-unnecessary-type-assertion": "off",- "@typescript-eslint/prefer-promise-reject-errors": "off","react-hooks/exhaustive-deps": "off",- "react-refresh/only-export-components": "off",},},];diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsxindex 11aa4d46e7..80c589a0a8 100644--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx@@ -18,15 +18,19 @@ import {LargeTileButton,LargeTileTextOverlay,} from "ente-new/photos/components/Tiles";-import {+import type {CollectionsSortBy,- type CollectionSummary,+ CollectionSummary,} from "ente-new/photos/services/collection-summary";import { t } from "i18next";import memoize from "memoize-one";import React, { useEffect, useRef, useState } from "react";import AutoSizer from "react-virtualized-auto-sizer";-import { areEqual, FixedSizeList, ListChildComponentProps } from "react-window";+import {+ areEqual,+ FixedSizeList,+ type ListChildComponentProps,+} from "react-window";interface AllAlbums {open: boolean;diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsxindex ba532a8c1d..25a44db6eb 100644--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx@@ -51,7 +51,7 @@ import { usePhotosAppContext } from "ente-new/photos/types/context";import { t } from "i18next";import React, { useCallback, useRef } from "react";import { Trans } from "react-i18next";-import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";+import type { SetFilesDownloadProgressAttributesCreator } from "types/gallery";import {downloadCollectionHelper,downloadDefaultHiddenCollectionHelper,@@ -221,15 +221,15 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({setActiveCollectionID(PseudoCollectionID.all);});- const _downloadCollection = () => {+ const _downloadCollection = async () => {if (isActiveCollectionDownloadInProgress()) return;if (collectionSummaryType == "hiddenItems") {- return downloadDefaultHiddenCollectionHelper(+ await downloadDefaultHiddenCollectionHelper(setFilesDownloadProgressAttributesCreator,);} else {- return downloadCollectionHelper(+ await downloadCollectionHelper(activeCollection.id,setFilesDownloadProgressAttributesCreator(activeCollection.name,diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsxindex 57854c0ce2..d97b5ac30c 100644--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx@@ -3,7 +3,7 @@ import {CollectionShare,type CollectionShareProps,} from "components/Collections/CollectionShare";-import { TimeStampListItem } from "components/FileList";+import type { TimeStampListItem } from "components/FileList";import { useModalVisibility } from "ente-base/components/utils/modal";import type { Collection } from "ente-media/collection";import {@@ -22,9 +22,9 @@ import { includes } from "ente-utils/type-guards";import React, { useCallback, useEffect, useMemo, useState } from "react";import { sortCollectionSummaries } from "services/collectionService";import {- FilesDownloadProgressAttributes,isFilesDownloadCancelled,isFilesDownloadCompleted,+ type FilesDownloadProgressAttributes,} from "../FilesDownloadProgress";import { AlbumCastDialog } from "./AlbumCastDialog";import {diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex e946d9dab7..46c3375d01 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -12,7 +12,7 @@ import { isSameDay } from "ente-base/date";import { formattedDateRelative } from "ente-base/i18n-date";import log from "ente-base/log";import { downloadManager } from "ente-gallery/services/download";-import { EnteFile } from "ente-media/file";+import type { EnteFile } from "ente-media/file";import { fileCreationTime, fileDurationString } from "ente-media/file-metadata";import { FileType } from "ente-media/file-type";import {@@ -34,10 +34,10 @@ import React, { useContext, useEffect, useMemo, useRef, useState } from "react";import { Trans } from "react-i18next";import {VariableSizeList as List,- ListChildComponentProps,+ type ListChildComponentProps,areEqual,} from "react-window";-import { SelectedState } from "types/gallery";+import type { SelectedState } from "types/gallery";import { shouldShowAvatar } from "utils/file";import {handleSelectCreator,diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsxindex b482a7ca72..07a1e42bb4 100644--- a/web/apps/photos/src/components/FileListWithViewer.tsx+++ b/web/apps/photos/src/components/FileListWithViewer.tsx@@ -6,7 +6,7 @@ import {type FileViewerProps,} from "ente-gallery/components/viewer/FileViewer";import type { Collection } from "ente-media/collection";-import { EnteFile } from "ente-media/file";+import type { EnteFile } from "ente-media/file";import { fileCreationTime, fileFileName } from "ente-media/file-metadata";import { moveToTrash } from "ente-new/photos/services/collection";import { PseudoCollectionID } from "ente-new/photos/services/collection-summary";@@ -14,7 +14,7 @@ import { t } from "i18next";import { useCallback, useMemo, useState } from "react";import AutoSizer from "react-virtualized-auto-sizer";import { uploadManager } from "services/upload-manager";-import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";+import type { SetFilesDownloadProgressAttributesCreator } from "types/gallery";import { downloadSingleFile } from "utils/file";import {FileList,diff --git a/web/apps/photos/src/components/FilesDownloadProgress.tsx b/web/apps/photos/src/components/FilesDownloadProgress.tsxindex b71c4f2521..da637938e3 100644--- a/web/apps/photos/src/components/FilesDownloadProgress.tsx+++ b/web/apps/photos/src/components/FilesDownloadProgress.tsx@@ -1,3 +1,5 @@+// TODO: Audit this file+/* eslint-disable react-refresh/only-export-components */import { useBaseContext } from "ente-base/context";import { Notification } from "ente-new/photos/components/Notification";import { t } from "i18next";diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsxindex 13899ebabf..5830d79014 100644--- a/web/apps/photos/src/components/Sidebar.tsx+++ b/web/apps/photos/src/components/Sidebar.tsx@@ -112,11 +112,11 @@ import { initiateEmail, openURL } from "ente-new/photos/utils/web";import { t } from "i18next";import { useRouter } from "next/router";import React, {- MouseEventHandler,useCallback,useEffect,useMemo,useState,+ type MouseEventHandler,} from "react";import { Trans } from "react-i18next";import { testUpload } from "../../tests/upload.test";diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsxindex 3343f26b01..1264eae2c4 100644--- a/web/apps/photos/src/components/Upload.tsx+++ b/web/apps/photos/src/components/Upload.tsx@@ -1,3 +1,5 @@+// TODO: Audit this file+/* eslint-disable @typescript-eslint/no-misused-promises */import ChevronRightIcon from "@mui/icons-material/ChevronRight";import DiscFullIcon from "@mui/icons-material/DiscFull";import GoogleIcon from "@mui/icons-material/Google";@@ -81,7 +83,7 @@ import type {} from "services/upload-manager";import { uploadManager } from "services/upload-manager";import watcher from "services/watch";-import { SetLoading } from "types/gallery";+import type { SetLoading } from "types/gallery";import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";import { UploadProgress } from "./UploadProgress";diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsxindex 9b762c5189..1afa305ace 100644--- a/web/apps/photos/src/components/UploadProgress.tsx+++ b/web/apps/photos/src/components/UploadProgress.tsx@@ -32,17 +32,17 @@ import { t } from "i18next";import memoize from "memoize-one";import React, {createContext,- ReactElement,useContext,useEffect,useState,+ type ReactElement,} from "react";import { Trans } from "react-i18next";import {areEqual,FixedSizeList as List,- ListChildComponentProps,- ListItemKeySelector,+ type ListChildComponentProps,+ type ListItemKeySelector,} from "react-window";import type {FinishedUploadType,diff --git a/web/apps/photos/src/components/pages/gallery/Avatar.tsx b/web/apps/photos/src/components/pages/gallery/Avatar.tsxindex 31da162bb0..0ee92ff32b 100644--- a/web/apps/photos/src/components/pages/gallery/Avatar.tsx+++ b/web/apps/photos/src/components/pages/gallery/Avatar.tsx@@ -1,7 +1,7 @@import { styled } from "@mui/material";import type { LocalUser } from "ente-accounts/services/user";import log from "ente-base/log";-import { EnteFile } from "ente-media/file";+import { type EnteFile } from "ente-media/file";import {avatarBackgroundColor,avatarBackgroundColorPublicCollectedFile,diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsxindex 5458061407..5b86b04ec0 100644--- a/web/apps/photos/src/pages/_app.tsx+++ b/web/apps/photos/src/pages/_app.tsx@@ -26,7 +26,7 @@ import { photosTheme } from "ente-base/components/utils/theme";import { BaseContext, deriveBaseContext } from "ente-base/context";import log from "ente-base/log";import { logStartupBanner } from "ente-base/log-web";-import { AppUpdate } from "ente-base/types/ipc";+import type { AppUpdate } from "ente-base/types/ipc";import {initVideoProcessing,isHLSGenerationSupported,@@ -81,7 +81,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {useEffect(() => {const electron = globalThis.electron;- if (!electron) return;+ if (!electron) return undefined;// Attach various listeners for events sent to us by the Node.js layer.// This is for events that we should listen for always, not just whendiff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 21173e9908..3db254fa7e 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -4,11 +4,11 @@ import MenuIcon from "@mui/icons-material/Menu";import { IconButton, Stack, Typography } from "@mui/material";import { AuthenticateUser } from "components/AuthenticateUser";import { GalleryBarAndListHeader } from "components/Collections/GalleryBarAndListHeader";-import { TimeStampListItem } from "components/FileList";+import { type TimeStampListItem } from "components/FileList";import { FileListWithViewer } from "components/FileListWithViewer";import {FilesDownloadProgress,- FilesDownloadProgressAttributes,+ type FilesDownloadProgressAttributes,} from "components/FilesDownloadProgress";import { FixCreationTime } from "components/FixCreationTime";import { Sidebar } from "components/Sidebar";@@ -120,10 +120,10 @@ import { PromiseQueue } from "ente-utils/promise";import { t } from "i18next";import { useRouter, type NextRouter } from "next/router";import { useCallback, useEffect, useMemo, useRef, useState } from "react";-import { FileWithPath } from "react-dropzone";+import type { FileWithPath } from "react-dropzone";import { Trans } from "react-i18next";import { uploadManager } from "services/upload-manager";-import {+import type {SelectedState,SetFilesDownloadProgressAttributes,SetFilesDownloadProgressAttributesCreator,@@ -1309,11 +1309,11 @@ const HiddenSectionNavbarContents: React.FC<** Check if these query parameters exist, and if so, act on them appropriately.*/-export async function handleSubscriptionCompletionRedirectIfNeeded(+const handleSubscriptionCompletionRedirectIfNeeded = async (showMiniDialog: (attributes: MiniDialogAttributes) => void,showLoadingBar: () => void,router: NextRouter,-) {+) => {const { session_id: sessionID, status, reason } = router.query;if (status == "success") {@@ -1378,4 +1378,4 @@ export async function handleSubscriptionCompletionRedirectIfNeeded();}}-}+};diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsxindex 705ea034c9..79e85a12c9 100644--- a/web/apps/photos/src/pages/shared-albums.tsx+++ b/web/apps/photos/src/pages/shared-albums.tsx@@ -6,11 +6,11 @@ import DownloadIcon from "@mui/icons-material/Download";import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";import { Box, Button, IconButton, Stack, styled, Tooltip } from "@mui/material";import Typography from "@mui/material/Typography";-import { TimeStampListItem } from "components/FileList";+import type { TimeStampListItem } from "components/FileList";import { FileListWithViewer } from "components/FileListWithViewer";import {FilesDownloadProgress,- FilesDownloadProgressAttributes,+ type FilesDownloadProgressAttributes,} from "components/FilesDownloadProgress";import { Upload } from "components/Upload";import {@@ -46,7 +46,7 @@ import { useBaseContext } from "ente-base/context";import {isHTTP401Error,isHTTPErrorWithStatus,- PublicAlbumsCredentials,+ type PublicAlbumsCredentials,} from "ente-base/http";import log from "ente-base/log";import { FullScreenDropZone } from "ente-gallery/components/FullScreenDropZone";@@ -83,7 +83,7 @@ import { useRouter } from "next/router";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { type FileWithPath } from "react-dropzone";import { uploadManager } from "services/upload-manager";-import {+import type {SelectedState,SetFilesDownloadProgressAttributes,SetFilesDownloadProgressAttributesCreator,diff --git a/web/apps/photos/src/services/collectionService.ts b/web/apps/photos/src/services/collectionService.tsindex 672ff93aa5..81bd297b57 100644--- a/web/apps/photos/src/services/collectionService.ts+++ b/web/apps/photos/src/services/collectionService.ts@@ -1,7 +1,9 @@import { sortFiles } from "ente-gallery/utils/file";-import { EnteFile } from "ente-media/file";-import type { CollectionSummary } from "ente-new/photos/services/collection-summary";-import { CollectionsSortBy } from "ente-new/photos/services/collection-summary";+import type { EnteFile } from "ente-media/file";+import type {+ CollectionsSortBy,+ CollectionSummary,+} from "ente-new/photos/services/collection-summary";export const sortCollectionSummaries = (collectionSummaries: CollectionSummary[],diff --git a/web/apps/photos/src/types/gallery/index.ts b/web/apps/photos/src/types/gallery/index.tsindex 12bd92ec9b..83500edab5 100644--- a/web/apps/photos/src/types/gallery/index.ts+++ b/web/apps/photos/src/types/gallery/index.ts@@ -1,4 +1,4 @@-import { FilesDownloadProgressAttributes } from "components/FilesDownloadProgress";+import { type FilesDownloadProgressAttributes } from "components/FilesDownloadProgress";import { type SelectionContext } from "ente-new/photos/components/gallery";export interface SelectedState {diff --git a/web/apps/photos/src/utils/collection.ts b/web/apps/photos/src/utils/collection.tsindex 8be190369b..50c2697da6 100644--- a/web/apps/photos/src/utils/collection.ts+++ b/web/apps/photos/src/utils/collection.ts@@ -2,7 +2,7 @@ import { ensureElectron } from "ente-base/electron";import { joinPath } from "ente-base/file-name";import log from "ente-base/log";import { uniqueFilesByID } from "ente-gallery/utils/file";-import { EnteFile } from "ente-media/file";+import type { EnteFile } from "ente-media/file";import {defaultHiddenCollectionUserFacingName,findDefaultHiddenCollectionIDs,@@ -13,9 +13,9 @@ import {savedCollections,} from "ente-new/photos/services/photos-fdb";import { safeDirectoryName } from "ente-new/photos/utils/native-fs";-import {+import type {SetFilesDownloadProgressAttributes,- type SetFilesDownloadProgressAttributesCreator,+ SetFilesDownloadProgressAttributesCreator,} from "types/gallery";import { downloadFilesWithProgress } from "utils/file";diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.tsindex 5558efaff0..df0c381204 100644--- a/web/apps/photos/src/utils/file/index.ts+++ b/web/apps/photos/src/utils/file/index.ts@@ -6,7 +6,7 @@ import { saveAsFileAndRevokeObjectURL } from "ente-base/utils/web";import { downloadManager } from "ente-gallery/services/download";import { detectFileTypeInfo } from "ente-gallery/utils/detect-type";import { writeStream } from "ente-gallery/utils/native-stream";-import { EnteFile } from "ente-media/file";+import type { EnteFile } from "ente-media/file";import { ItemVisibility, fileFileName } from "ente-media/file-metadata";import { FileType } from "ente-media/file-type";import { decodeLivePhoto } from "ente-media/live-photo";@@ -21,7 +21,7 @@ import { updateFilesVisibility } from "ente-new/photos/services/file";import { safeFileName } from "ente-new/photos/utils/native-fs";import { wait } from "ente-utils/promise";import { t } from "i18next";-import {+import type {SelectedState,SetFilesDownloadProgressAttributes,SetFilesDownloadProgressAttributesCreator,diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.tsindex 9f68a08658..33e902cc6f 100644--- a/web/apps/photos/src/utils/photoFrame/index.ts+++ b/web/apps/photos/src/utils/photoFrame/index.ts@@ -1,6 +1,6 @@import type { SelectionContext } from "ente-new/photos/components/gallery";import type { GalleryBarMode } from "ente-new/photos/components/gallery/reducer";-import { SetSelectedState, type SelectedState } from "types/gallery";+import type { SelectedState, SetSelectedState } from "types/gallery";// TODO: All this is unnecessarily complex, and needs reworking.export const handleSelectCreator =diff --git a/web/apps/photos/src/utils/publicCollectionGallery/index.ts b/web/apps/photos/src/utils/publicCollectionGallery/index.tsindex 58a856e558..921c344ebc 100644--- a/web/apps/photos/src/utils/publicCollectionGallery/index.ts+++ b/web/apps/photos/src/utils/publicCollectionGallery/index.ts@@ -1,4 +1,4 @@-import { TimeStampListItem } from "components/FileList";+import type { TimeStampListItem } from "components/FileList";import type { PublicAlbumsCredentials } from "ente-base/http";import { createContext } from "react";diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.tsindex ec4812998c..7f1bbcfd7e 100644--- a/web/apps/photos/tests/upload.test.ts+++ b/web/apps/photos/tests/upload.test.ts@@ -1,7 +1,9 @@-/* eslint-disable @typescript-eslint/no-base-to-string */// TODO: Audit this file+/* eslint-disable @typescript-eslint/ban-ts-comment */+/* eslint-disable @typescript-eslint/no-base-to-string *//* eslint-disable @typescript-eslint/restrict-template-expressions *//* eslint-disable @typescript-eslint/dot-notation */+// @ts-nocheckimport {parseDateFromDigitGroups,tryParseEpochMicrosecondsFromFileName,diff --git a/web/apps/photos/tsconfig.json b/web/apps/photos/tsconfig.jsonindex 9892dd4883..4b0f70e320 100644--- a/web/apps/photos/tsconfig.json+++ b/web/apps/photos/tsconfig.json@@ -5,14 +5,8 @@"baseUrl": "./src",/* Override tsconfig-next.json (TODO: Remove all of us) */- "verbatimModuleSyntax": false,"noImplicitAny": false,- "noUnusedLocals": false,- "noUnusedParameters": false,- "noImplicitReturns": false,- "noUncheckedIndexedAccess": false,- "strictNullChecks": false,- "useUnknownInCatchVariables": false+ "strictNullChecks": false},"include": ["next-env.d.ts",diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsxindex 80a9014e01..92f06a085e 100644--- a/web/packages/gallery/components/FileInfo.tsx+++ b/web/packages/gallery/components/FileInfo.tsx@@ -215,7 +215,7 @@ export const FileInfo: React.FC<FileInfoProps> = ({const annotatedExif = useMemo(() => annotateExif(exif), [exif]);useEffect(() => {- if (!isMLEnabled()) return;+ if (!isMLEnabled()) return undefined;// Take a dependency on open so that we refresh the list of people by// calling `getAnnotatedFacesForFile` again when the file info dialog is@@ -230,7 +230,7 @@ export const FileInfo: React.FC<FileInfoProps> = ({// Since the `file` hasn't changed, this hook wouldn't rerun. So we also// take a dependency on the open state of the dialog, causing us to// rerun whenever reopened (even if for the same file).- if (!open) return;+ if (!open) return undefined;let didCancel = false;diff --git a/web/packages/gallery/components/viewer/data-source.ts b/web/packages/gallery/components/viewer/data-source.tsindex f13df294b4..2325584b27 100644--- a/web/packages/gallery/components/viewer/data-source.ts+++ b/web/packages/gallery/components/viewer/data-source.ts@@ -723,15 +723,15 @@ export const updateFileInfoExifIfNeeded = async (itemData: ItemData) => {// We already have it available.if (_state.fileInfoExifByFileID.has(fileID)) return;- const updateNotifyAndReturn = (exifData: FileInfoExif) => {+ const update = (exifData: FileInfoExif) => {_state.fileInfoExifByFileID.set(fileID, exifData);_state.exifObserverByFileID.get(fileID)?.(exifData);- return exifData;};// For videos, insert a placeholder.if (fileType == FileType.video) {- return updateNotifyAndReturn(createPlaceholderFileInfoExif());+ update(createPlaceholderFileInfoExif());+ return;}// This is not a video, but the original image is not available yet.@@ -741,12 +741,12 @@ export const updateFileInfoExifIfNeeded = async (itemData: ItemData) => {const file = new File([originalImageBlob], "");const tags = await extractRawExif(file);const parsed = parseExif(tags);- return updateNotifyAndReturn({ tags, parsed });+ update({ tags, parsed });} catch (e) {log.error("Failed to extract exif", e);// Save the empty placeholder exif corresponding to the file, no point// in unnecessarily retrying this, it will deterministically fail again.- return updateNotifyAndReturn(createPlaceholderFileInfoExif());+ update(createPlaceholderFileInfoExif());}};diff --git a/web/packages/new/photos/components/Tiles.tsx b/web/packages/new/photos/components/Tiles.tsxindex 2572257453..bf8318d832 100644--- a/web/packages/new/photos/components/Tiles.tsx+++ b/web/packages/new/photos/components/Tiles.tsx@@ -66,7 +66,7 @@ export const ItemCard: React.FC<React.PropsWithChildren<ItemCardProps>> = ({const [coverImageURL, setCoverImageURL] = useState<string | undefined>();useEffect(() => {- if (!coverFile) return;+ if (!coverFile) return undefined;let didCancel = false;diff --git a/web/packages/new/photos/components/gallery/BarImpl.tsx b/web/packages/new/photos/components/gallery/BarImpl.tsxindex 27198b86dc..757032f998 100644--- a/web/packages/new/photos/components/gallery/BarImpl.tsx+++ b/web/packages/new/photos/components/gallery/BarImpl.tsx@@ -146,7 +146,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({>((ref) => {listContainerRef.current = ref;- if (!ref) return;+ if (!ref) return undefined;// Listen for scrolls and resize.ref.addEventListener("scroll", updateScrollState);