From 0e494fc22bafd56b1f786985cdcfa00fe634abc6 Mon Sep 17 00:00:00 2001 From: AntonMacG Date: Mon, 13 Nov 2023 09:49:50 +0000 Subject: [PATCH] Updated validateWhitelist --- src/plugins/replyPingControl/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/replyPingControl/index.ts b/src/plugins/replyPingControl/index.ts index 2ce74bad6..3c9cdd15f 100644 --- a/src/plugins/replyPingControl/index.ts +++ b/src/plugins/replyPingControl/index.ts @@ -75,7 +75,12 @@ export default definePlugin({ function validateWhitelist(value: string) { const whitelist = parseWhitelist(value); - return !whitelist.some(id => !isValidUserId(id)); + 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) {