Add try catch to erase data button
This commit is contained in:
parent
e73d6d8317
commit
e81430be80
@ -57,10 +57,14 @@ function SettingsModal({ isOpen, onRequestClose }) {
|
||||
|
||||
async function handleEraseAllData() {
|
||||
setIsLoading(true);
|
||||
localStorage.clear();
|
||||
database.close();
|
||||
await database.delete();
|
||||
window.location.reload();
|
||||
try {
|
||||
localStorage.clear();
|
||||
database.close();
|
||||
await database.delete();
|
||||
} catch {
|
||||
} finally {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClearCache() {
|
||||
|
Loading…
Reference in New Issue
Block a user