mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 23:38:32 +00:00
:husk:
This commit is contained in:
parent
0e494fc22b
commit
400e9705e5
1 changed files with 4 additions and 12 deletions
|
@ -24,10 +24,12 @@ export const settings = definePluginSettings({
|
|||
default: "",
|
||||
disabled: () => settings.store.alwaysPingOnReply,
|
||||
onChange: newValue => {
|
||||
cachedWhitelist = parseWhitelist(newValue);
|
||||
if (!validateWhitelist(newValue)) {
|
||||
const newWhitelist = parseWhitelist(newValue);
|
||||
|
||||
if (newWhitelist.length === 0 && newValue.trim() !== "") {
|
||||
showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
|
||||
} else {
|
||||
cachedWhitelist = newWhitelist;
|
||||
showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
|
||||
}
|
||||
}
|
||||
|
@ -73,16 +75,6 @@ export default definePlugin({
|
|||
},
|
||||
});
|
||||
|
||||
function validateWhitelist(value: string) {
|
||||
const whitelist = parseWhitelist(value);
|
||||
if (whitelist.length === 0 && value.trim() !== "") {
|
||||
showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
|
||||
return false;
|
||||
}
|
||||
showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
|
||||
return true;
|
||||
}
|
||||
|
||||
function parseWhitelist(value: string) {
|
||||
return value.split(",")
|
||||
.map(id => id.trim())
|
||||
|
|
Loading…
Add table
Reference in a new issue