Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web] Default notifications to three-second auto-hide

AswinAsokb94e26a16cf1
diff --git a/web/apps/ensu/src/components/chat/ChatDialogs.tsx b/web/apps/ensu/src/components/chat/ChatDialogs.tsx
index c4faf87c72..1971944999 100644
--- a/web/apps/ensu/src/components/chat/ChatDialogs.tsx
+++ b/web/apps/ensu/src/components/chat/ChatDialogs.tsx
@@ -1738,6 +1738,7 @@ export const ChatDialogs = memo(
open={chatNotificationOpen}
onClose={() => setChatNotificationOpen(false)}
attributes={chatNotification}
+ autoHideDuration={null}
horizontal={isSmall ? "left" : "right"}
vertical="bottom"
sx={{
diff --git a/web/apps/photos/src/components/QuickLinkCreatedNotification.tsx b/web/apps/photos/src/components/QuickLinkCreatedNotification.tsx
index 2e48d09efe..8babfceb50 100644
--- a/web/apps/photos/src/components/QuickLinkCreatedNotification.tsx
+++ b/web/apps/photos/src/components/QuickLinkCreatedNotification.tsx
@@ -53,6 +53,7 @@ export const QuickLinkCreatedNotification: React.FC<
open={open}
onClose={onClose}
keepOpenOnClick
+ autoHideDuration={null}
attributes={{
color: "inherit",
startIcon: null,
diff --git a/web/packages/base/components/Notification.tsx b/web/packages/base/components/Notification.tsx
index 1bf3e2f3c0..ef10dfb5b0 100644
--- a/web/packages/base/components/Notification.tsx
+++ b/web/packages/base/components/Notification.tsx
@@ -44,7 +44,8 @@ type NotificationProps = ModalVisibilityProps & {
keepOpenOnClick?: boolean;
horizontal?: "left" | "right";
vertical?: "top" | "bottom";
- autoHideDuration?: number;
+ // Set to null to keep the notification open until dismissed.
+ autoHideDuration?: number | null;
sx?: SxProps<Theme>;
};
@@ -75,7 +76,7 @@ export const Notification: React.FC<NotificationProps> = ({
onClose,
horizontal = "right",
vertical = "bottom",
- autoHideDuration,
+ autoHideDuration = 3000,
sx,
attributes,
keepOpenOnClick,
diff --git a/web/packages/gallery/components/DownloadStatusNotifications.tsx b/web/packages/gallery/components/DownloadStatusNotifications.tsx
index 5ce2e2cc62..63bcb252e7 100644
--- a/web/packages/gallery/components/DownloadStatusNotifications.tsx
+++ b/web/packages/gallery/components/DownloadStatusNotifications.tsx
@@ -28,7 +28,6 @@ import { t } from "i18next";
import { useState } from "react";
const MAX_ALBUM_NAME_LENGTH = 25;
-const SINGLE_FILE_SUCCESS_AUTO_CLOSE_DELAY_MS = 3000;
const truncateAlbumName = (name: string): string => {
if (name.length <= MAX_ALBUM_NAME_LENGTH) return name;
@@ -237,11 +236,7 @@ export const DownloadStatusNotifications: React.FC<
})}
open={true}
onClose={createOnClose(group)}
- autoHideDuration={
- shouldAutoClose
- ? SINGLE_FILE_SUCCESS_AUTO_CLOSE_DELAY_MS
- : undefined
- }
+ autoHideDuration={shouldAutoClose ? undefined : null}
keepOpenOnClick
attributes={{
color: hasErrors ? "critical" : "secondary",