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