π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Complete
Manav Rathiec11bc70924e
diff --git a/web/packages/gallery/components/viewer/data-source.ts b/web/packages/gallery/components/viewer/data-source.tsindex dc0901cca5..7b931d488b 100644--- a/web/packages/gallery/components/viewer/data-source.ts+++ b/web/packages/gallery/components/viewer/data-source.ts@@ -224,8 +224,11 @@ export const itemDataForFile = (file: EnteFile, needsRefresh: () => void) => {* This is called when the user moves away from a slide so that we attempt a* full retry when they come back the next time.*/-export const forgetFailedItemDataForFile = (file: EnteFile) =>- forgetFailedItemDataForFileID(file.id);+export const forgetFailedItemDataForFileID = (fileID: number) => {+ if (_state.itemDataByFileID.get(fileID)?.fetchFailed) {+ _state.itemDataByFileID.delete(fileID);+ }+};/*** Forget item data for the all files whose fetch had failed.@@ -236,12 +239,6 @@ export const forgetFailedItemDataForFile = (file: EnteFile) =>export const forgetFailedItems = () =>[..._state.itemDataByFileID.keys()].forEach(forgetFailedItemDataForFileID);-const forgetFailedItemDataForFileID = (fileID: number) => {- if (_state.itemDataByFileID.get(fileID)?.fetchFailed) {- _state.itemDataByFileID.delete(fileID);- }-};-const enqueueUpdates = async (file: EnteFile) => {const fileID = file.id;const fileType = file.metadata.fileType;diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.tsindex f8bf5e1a09..6cfe8f4918 100644--- a/web/packages/gallery/components/viewer/photoswipe.ts+++ b/web/packages/gallery/components/viewer/photoswipe.ts@@ -9,7 +9,7 @@ import { t } from "i18next";import {forgetExif,forgetExifForItemData,- forgetFailedItemDataForFile,+ forgetFailedItemDataForFileID,forgetFailedItems,itemDataForFile,updateFileInfoExifIfNeeded,@@ -402,9 +402,8 @@ export class FileViewerPhotoSwipe {// more than 2 slides and then back, or if they reopen the viewer.//// See: [Note: File viewer error handling]- // TODO- console.log(currentFile(), e);- forgetFailedItemDataForFile(currentFile());+ const fileID = e.content?.data?.fileID;+ if (fileID) forgetFailedItemDataForFileID(fileID);// Pause the video element, if any, when we move away from the// slide.