/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { useSettings } from "@api/Settings"; import { Margins } from "@utils/margins"; import { identity } from "@utils/misc"; import { ModalCloseButton, ModalContent, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { Forms, Select, Slider, Text } from "@webpack/common"; import { ErrorCard } from ".."; export function NotificationSettings() { const settings = useSettings().notifications; return (
Notification Style {settings.useNative !== "never" && Notification?.permission === "denied" && ( Desktop Notification Permission denied You have denied Notification Permissions. Thus, Desktop notifications will not work! )} Some plugins may show you notifications. These come in two styles: >} select={v => settings.position = v} isSelected={v => v === settings.position} serialize={identity} /> Notification Timeout Set to 0s to never automatically time out settings.timeout = v} onValueRender={v => (v / 1000).toFixed(2) + "s"} onMarkerRender={v => (v / 1000) + "s"} stickToMarkers={false} /> Notification Log Limit The amount of notifications to save in the log until old ones are removed. Set to 0 to disable Notification log and to never automatically remove old Notifications settings.logLimit = v} onValueRender={v => v === 200 ? "∞" : v} onMarkerRender={v => v === 200 ? "∞" : v} />
); } export function openNotificationSettingsModal() { openModal(props => ( Notification Settings )); }