diff --git a/src/components/settings/tabs/plugins/index.tsx b/src/components/settings/tabs/plugins/index.tsx index 34e326c58..c4c313b27 100644 --- a/src/components/settings/tabs/plugins/index.tsx +++ b/src/components/settings/tabs/plugins/index.tsx @@ -139,31 +139,34 @@ function ExcludedPluginsList({ search }: { search: string; }) { export default function PluginSettings() { const settings = useSettings(); const changes = React.useMemo(() => new ChangeList(), []); - const changeArray = changes.map(s => s); React.useEffect(() => { - return () => void (changes.hasChanges && Alerts.show({ - title: "Restart required", - body: ( - <> -

The following plugins require a restart:

+ return () => { + if (!changes.hasChanges) return; + + const allChanges = [...changes.getChanges()]; + const maxDisplay = 15; + const displayed = allChanges.slice(0, maxDisplay); + const remainingCount = allChanges.length - displayed.length; + + Alerts.show({ + title: "Restart required", + body: (
- {changeArray.slice(0, 15).map((s, i) => ( + {displayed.map((s, i) => ( {i > 0 && ", "} {Parser.parse("`" + s + "`")} ))} - {changeArray.length > 15 && ( - and {changeArray.length - 15} more - )} + {remainingCount > 0 && and {remainingCount} more}
- - ), - confirmText: "Restart now", - cancelText: "Later!", - onConfirm: () => location.reload() - })); + ), + confirmText: "Restart now", + cancelText: "Later!", + onConfirm: () => location.reload() + }); + }; }, []); const depMap = Vencord.Plugins.calculatePluginDependencyMap(); diff --git a/src/equicordplugins/blockKeywords/index.ts b/src/equicordplugins/blockKeywords/index.ts index 9535387a4..36a76e65b 100644 --- a/src/equicordplugins/blockKeywords/index.ts +++ b/src/equicordplugins/blockKeywords/index.ts @@ -39,7 +39,7 @@ const settings = definePluginSettings({ }); export function containsBlockedKeywords(message: Message) { - if (blockedKeywords.length === 0) { return false; } + if (!blockedKeywords || blockedKeywords.length === 0) { return false; } // can't use forEach because we need to return from inside the loop // message content loop