refactored
This commit is contained in:
parent
ae99b8eeb7
commit
e8aef99512
1 changed files with 2 additions and 3 deletions
|
@ -278,9 +278,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
setIsLoggedIn(false);
|
setIsLoggedIn(false);
|
||||||
localStorage.removeItem('accountName');
|
localStorage.clear();
|
||||||
localStorage.removeItem('accountEmail');
|
|
||||||
localStorage.removeItem('accountPassword');
|
|
||||||
alert('Successfully logged out!');
|
alert('Successfully logged out!');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
};
|
};
|
||||||
|
@ -367,6 +365,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
if (useName && usePassword) {
|
if (useName && usePassword) {
|
||||||
const success = await deleteAccount(useName, usePassword);
|
const success = await deleteAccount(useName, usePassword);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
localStorage.clear();
|
||||||
alert('Account deleted successfully!');
|
alert('Account deleted successfully!');
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
// Optionally, redirect or reset state here
|
// Optionally, redirect or reset state here
|
||||||
|
|
Loading…
Reference in a new issue