mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 17:57:31 +00:00
err 1
This commit is contained in:
@@ -15,6 +15,7 @@ if (process.env.NEXT_PUBLIC_ENTE_WIP_PS5) {
|
|||||||
|
|
||||||
import { isDesktop } from "@/base/app";
|
import { isDesktop } from "@/base/app";
|
||||||
import { type ModalVisibilityProps } from "@/base/components/utils/modal";
|
import { type ModalVisibilityProps } from "@/base/components/utils/modal";
|
||||||
|
import { useBaseContext } from "@/base/context";
|
||||||
import { lowercaseExtension } from "@/base/file-name";
|
import { lowercaseExtension } from "@/base/file-name";
|
||||||
import type { LocalUser } from "@/base/local-user";
|
import type { LocalUser } from "@/base/local-user";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
@@ -159,6 +160,8 @@ const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
onSelectPerson,
|
onSelectPerson,
|
||||||
onSaveEditedImageCopy,
|
onSaveEditedImageCopy,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { onGenericError } = useBaseContext();
|
||||||
|
|
||||||
// There are 3 things involved in this dance:
|
// There are 3 things involved in this dance:
|
||||||
//
|
//
|
||||||
// 1. Us, "FileViewer". We're a React component.
|
// 1. Us, "FileViewer". We're a React component.
|
||||||
@@ -306,7 +309,12 @@ const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
if (!showModifyActions || !favoriteFileIDs)
|
if (!showModifyActions || !favoriteFileIDs)
|
||||||
throw new Error("Unexpected invocation");
|
throw new Error("Unexpected invocation");
|
||||||
|
|
||||||
await new Promise((r) => setTimeout(r, 7000));
|
try {
|
||||||
|
await new Promise((r) => setTimeout(r, 3000));
|
||||||
|
throw new Error("test");
|
||||||
|
} catch (e) {
|
||||||
|
onGenericError(e);
|
||||||
|
}
|
||||||
console.log({ file, annotation });
|
console.log({ file, annotation });
|
||||||
// TODO
|
// TODO
|
||||||
// const isFavorite = annotation.isFavorite;
|
// const isFavorite = annotation.isFavorite;
|
||||||
@@ -323,7 +331,7 @@ const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
// onMarkUnsyncedFavoriteUpdate(file.id, undefined);
|
// onMarkUnsyncedFavoriteUpdate(file.id, undefined);
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
[showModifyActions, favoriteFileIDs],
|
[showModifyActions, onGenericError, favoriteFileIDs],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Initial value of delegate.
|
// Initial value of delegate.
|
||||||
|
@@ -90,7 +90,11 @@ export interface FileViewerPhotoSwipeDelegate {
|
|||||||
* Called when the user activates the toggle favorite action on a file.
|
* Called when the user activates the toggle favorite action on a file.
|
||||||
*
|
*
|
||||||
* The toggle favorite button will be disabled for the file until the
|
* The toggle favorite button will be disabled for the file until the
|
||||||
* promise returned by this function returns settles.
|
* promise returned by this function returns fulfills.
|
||||||
|
*
|
||||||
|
* > Note: The caller is expected to handle any errors that occur, and
|
||||||
|
* > should not reject for foreseeable failures, otherwise the button will
|
||||||
|
* > remain in the disabled state (until the file viewer is closed).
|
||||||
*/
|
*/
|
||||||
toggleFavorite: (annotatedFile: FileViewerAnnotatedFile) => Promise<void>;
|
toggleFavorite: (annotatedFile: FileViewerAnnotatedFile) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user