From dbedf19d2b3f7b70fbb513766e2c5b6a6d720bfd Mon Sep 17 00:00:00 2001 From: "Win8.1VMUser" <78744628+Win81VMUser@users.noreply.github.com> Date: Sun, 27 Jul 2025 18:48:35 +0200 Subject: [PATCH] Update Settings.ts --- plugins/nsfwbypass/src/Settings.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/nsfwbypass/src/Settings.ts b/plugins/nsfwbypass/src/Settings.ts index 369edda..e511f6c 100644 --- a/plugins/nsfwbypass/src/Settings.ts +++ b/plugins/nsfwbypass/src/Settings.ts @@ -24,20 +24,22 @@ export const Settings: React.FC = () => { storage.showWarningPopup ??= true; const handleAgeBypassToggle = (value: boolean) => { - if (value) { - // Show password field instead of alert + if (value && !storage.ageBypass) { + // Show password field when trying to enable setShowPasswordField(true); setPasswordInput(""); - } else { + } else if (!value) { // User is disabling - no password needed storage.ageBypass = false; setShowPasswordField(false); showToast("Age bypass disabled", findByProps("getAssetByName")?.getAssetByName("ic_info")?.id); } + // If already enabled and trying to enable again, do nothing }; const handlePasswordSubmit = () => { - if (passwordInput === AGE_BYPASS_PASSWORD) { + // Convert both to strings for comparison + if (passwordInput === AGE_BYPASS_PASSWORD.toString() || passwordInput === AGE_BYPASS_PASSWORD) { storage.ageBypass = true; setShowPasswordField(false); setPasswordInput("");