Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathi0db9bd04a1c3
diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx
index 3e444b93df..8e8a02d3bc 100644
--- a/web/apps/photos/src/components/PhotoViewer/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/index.tsx
@@ -49,7 +49,6 @@ import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";
import { trashFiles } from "services/fileService";
import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";
-import { isClipboardItemPresent } from "utils/common";
import { pauseVideo, playVideo } from "utils/photoFrame";
import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";
import { getTrashFileMessage } from "utils/ui";
@@ -126,7 +125,10 @@ function PhotoViewer(props: Iprops) {
const needUpdate = useRef(false);
const exifExtractionInProgress = useRef<string>(null);
- const shouldShowCopyOption = useMemo(() => isClipboardItemPresent(), []);
+ const shouldShowCopyOption = useMemo(
+ () => typeof ClipboardItem != "undefined",
+ [],
+ );
const [showImageEditorOverlay, setShowImageEditorOverlay] = useState(false);
diff --git a/web/apps/photos/src/utils/common/index.ts b/web/apps/photos/src/utils/common/index.ts
index 91628f98c4..63d9357ebd 100644
--- a/web/apps/photos/src/utils/common/index.ts
+++ b/web/apps/photos/src/utils/common/index.ts
@@ -6,10 +6,6 @@ export const preloadImage = (imgBasePath: string) => {
new Image().srcset = srcSet.join(",");
};
-export function isClipboardItemPresent() {
- return typeof ClipboardItem !== "undefined";
-}
-
export function batch<T>(arr: T[], batchSize: number): T[][] {
const batches: T[][] = [];
for (let i = 0; i < arr.length; i += batchSize) {