Add try catch to erase data button

This commit is contained in:
Mitchell McCaffrey 2021-06-12 19:00:01 +10:00
parent e73d6d8317
commit e81430be80

View File

@ -57,10 +57,14 @@ function SettingsModal({ isOpen, onRequestClose }) {
async function handleEraseAllData() { async function handleEraseAllData() {
setIsLoading(true); setIsLoading(true);
localStorage.clear(); try {
database.close(); localStorage.clear();
await database.delete(); database.close();
window.location.reload(); await database.delete();
} catch {
} finally {
window.location.reload();
}
} }
async function handleClearCache() { async function handleClearCache() {