Add Notification badge

This commit is contained in:
V
2023-06-23 17:20:54 +02:00
parent dde696627e
commit 31799ccfb0
28 changed files with 125 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ import "./settings.css";
import { Margins } from "@vencord/types/utils";
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
import { setBadge } from "renderer/appBadge";
import { useSettings } from "renderer/settings";
export default function SettingsUi() {
@@ -72,6 +73,18 @@ export default function SettingsUi() {
Start With System
</Switch>
<Switch
value={Settings.appBadge ?? true}
onChange={v => {
Settings.appBadge = v;
if (v) setBadge();
else VencordDesktopNative.app.setBadgeCount(0);
}}
note="Show mention badge on the app icon"
>
Notification Badge
</Switch>
{switches.map(([key, text, note, def, predicate]) => (
<Switch
value={(Settings[key as any] ?? def ?? false) && predicate?.() !== false}