This commit is contained in:
Patrick_Pluto 2024-10-10 08:34:27 +02:00
parent 3ec587bfd7
commit 491229a1b0
2 changed files with 21 additions and 22 deletions

View file

@ -12,9 +12,11 @@ import PrivacySettings from './PrivacySettings';
import FontSizeSetting from './FontSize';
import OpenSourceModeToggle from './OpenSourceToggle';
import {
changeHistory,
changeSettings,
createAccount,
deleteAccount,
getHistory,
} from '../../backend/database';
import ThemeDropdown from './DropDownTheme';
@ -372,7 +374,11 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
localStorage.setItem("currentEmail", useEmail)
alert('Account successfully changed!')
window.location.reload()
} else {
alert("failed to send settings")
}
} else {
alert("failed to create account")
}
}
};
@ -409,7 +415,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
checked={myBoolean}
setChecked={setMyBoolean}
/>
<TextSettings
<TextSettings
label="Nearest City"
value={weatherInfo}
type='text'
@ -624,6 +630,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
onClick={handleLogout} // Function to call on click
className="update-credentials-button" // Custom styling class
/>
<p>WARNING: Will delete your chat history.</p>
<ButtonSetting
label="Update Credentials" // Button label
onClick={handleUpdateCredentials} // Function to call on click