Update Settings.ts

This commit is contained in:
Win8.1VMUser 2025-07-27 18:48:35 +02:00 • committed by GitHub
parent 04962b01f5
commit dbedf19d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,20 +24,22 @@ export const Settings: React.FC<SettingsProps> = () => {
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("");