diff --git a/src/api/Notifications/NotificationComponent.tsx b/src/api/Notifications/NotificationComponent.tsx index 036cacd0..29cd68f3 100644 --- a/src/api/Notifications/NotificationComponent.tsx +++ b/src/api/Notifications/NotificationComponent.tsx @@ -20,7 +20,7 @@ import "./styles.css"; import { useSettings } from "@api/settings"; import ErrorBoundary from "@components/ErrorBoundary"; -import { Forms, React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from "@webpack/common"; +import { React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from "@webpack/common"; import { NotificationData } from "./Notifications"; @@ -32,7 +32,8 @@ export default ErrorBoundary.wrap(function NotificationComponent({ icon, onClick, onClose, - image + image, + permanent }: NotificationData) { const { timeout, position } = useSettings(["notifications.timeout", "notifications.position"]).notifications; const hasFocus = useStateFromStores([WindowStore], () => WindowStore.isFocused()); @@ -43,7 +44,7 @@ export default ErrorBoundary.wrap(function NotificationComponent({ const start = useMemo(() => Date.now(), [timeout, isHover, hasFocus]); useEffect(() => { - if (isHover || !hasFocus || timeout === 0) return void setElapsed(0); + if (isHover || !hasFocus || timeout === 0 || permanent) return void setElapsed(0); const intervalId = setInterval(() => { const elapsed = Date.now() - start; @@ -74,14 +75,36 @@ export default ErrorBoundary.wrap(function NotificationComponent({
{icon && }
- {title} +
+

{title}

+ +
{richBody ??

{body}

}
{image && } - {timeout !== 0 && ( + {timeout !== 0 && !permanent && (