Skip to content

armgit / ente

Public Imported from GitHub
0

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

Maybe

Manav Rathic0eeb7dd2f5f
diff --git a/web/packages/gallery/components/utils/use-file-input.ts b/web/packages/gallery/components/utils/use-file-input.ts
index e46141d9e9..44e923af22 100644
--- a/web/packages/gallery/components/utils/use-file-input.ts
+++ b/web/packages/gallery/components/utils/use-file-input.ts
@@ -71,7 +71,8 @@ export const useFileInput = ({
// https://github.com/facebook/react/issues/27858
inputRef.current!.addEventListener("cancel", onCancel);
return () => {
- inputRef.current!.removeEventListener("cancel", onCancel);
+ // Use optional chaining to avoid spurious errors during HMR.
+ inputRef.current?.removeEventListener("cancel", onCancel);
};
}, [onCancel]);