Add option to delete local database if fails to load
This commit is contained in:
@@ -157,6 +157,9 @@
|
||||
<div id="packet-history" class="fullscreen-overlay">
|
||||
</div>
|
||||
|
||||
<div id="database-error" class="fullscreen-overlay">
|
||||
</div>
|
||||
|
||||
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js" type="module"></script>
|
||||
<script src="lib/jquery-3.4.1.min.js" type="text/javascript"></script>
|
||||
<script src="lib/notify.min.js" type="text/javascript"></script>
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user