Add option to delete local database if fails to load

This commit is contained in:
Ross
2020-06-14 10:26:13 +01:00
parent 418db8fe56
commit 33cf633ddf
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -63,6 +63,12 @@ function retrievePacketList() {
async function loadPacketList(data) {
let sessions = await window.db.session.toArray().catch(function(error) {
console.log("Error loading session", error);
$("#database-error").text("Error loading the database, schema has probably changed and needs updating. You will probably need to delete the local database.")
delete_button = $("<button>").click(()=>{
window.indexedDB.deleteDatabase("answers_database");
location.reload();
})
$("#database-error").append("")
});
// db.session
// .where("packet")