Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(Notitication):capturing-clickaway-events

Aswin Asok3c4ddb8ae781
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index dd06e23e59..85fe9188b5 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1008,7 +1008,6 @@ const Page: React.FC = () => {
startIcon: <CheckCircleIcon />,
title: t("added_to_person"),
caption: personName,
- autoHideDuration: 3000,
});
} catch (e) {
onGenericError(e);
diff --git a/web/packages/new/photos/components/FileContextMenu.tsx b/web/packages/new/photos/components/FileContextMenu.tsx
index 8aa0f736e8..3d265c0770 100644
--- a/web/packages/new/photos/components/FileContextMenu.tsx
+++ b/web/packages/new/photos/components/FileContextMenu.tsx
@@ -84,6 +84,15 @@ const actionConfigs: Record<FileContextAction, ActionConfig> = {
*/
export const FileContextMenu: React.FC<FileContextMenuProps> = memo(
({ open, anchorPosition, onClose, actions, onAction }) => {
+ const adjustedAnchorPosition = useMemo(() => {
+ if (!anchorPosition) return undefined;
+ const offset = 8;
+ return {
+ top: anchorPosition.top + offset,
+ left: anchorPosition.left + offset,
+ };
+ }, [anchorPosition]);
+
const handleActionClick = useCallback(
(action: FileContextAction) => {
onClose();
@@ -111,7 +120,7 @@ export const FileContextMenu: React.FC<FileContextMenuProps> = memo(
open={open}
onClose={onClose}
anchorReference="anchorPosition"
- anchorPosition={anchorPosition}
+ anchorPosition={adjustedAnchorPosition}
slotProps={{
root: {
onContextMenu: (e: React.MouseEvent) =>
diff --git a/web/packages/new/photos/components/Notification.tsx b/web/packages/new/photos/components/Notification.tsx
index 9ee62d48d4..c9b44ef8ca 100644
--- a/web/packages/new/photos/components/Notification.tsx
+++ b/web/packages/new/photos/components/Notification.tsx
@@ -76,7 +76,6 @@ export interface NotificationAttributes {
* If set, the notification will automatically close after this many
* milliseconds.
*/
- autoHideDuration?: number;
}
type NotificationProps = ModalVisibilityProps & {
@@ -102,11 +101,6 @@ type NotificationProps = ModalVisibilityProps & {
* Default: "bottom".
*/
vertical?: "top" | "bottom";
- /**
- * If set, the notification will automatically close after this many
- * milliseconds.
- */
- autoHideDuration?: number;
/**
* sx props to customize the appearance of the underlying MUI
* {@link Snackbar}.
@@ -131,7 +125,6 @@ export const Notification: React.FC<NotificationProps> = ({
onClose,
horizontal,
vertical,
- autoHideDuration,
sx,
attributes,
keepOpenOnClick,
@@ -147,7 +140,6 @@ export const Notification: React.FC<NotificationProps> = ({
endIcon,
onClick,
onEndIconClick,
- autoHideDuration: attrAutoHideDuration,
} = attributes;
const handleClose: React.MouseEventHandler = (event) => {
@@ -172,8 +164,6 @@ export const Notification: React.FC<NotificationProps> = ({
return (
<Snackbar
open={open}
- autoHideDuration={attrAutoHideDuration ?? autoHideDuration}
- onClose={onClose}
anchorOrigin={{
horizontal: horizontal ?? "right",
vertical: vertical ?? "bottom",