From 978458f17e7355b98d5fb35c2f3ab3e1e08c8a10 Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 14 Jun 2020 10:39:01 +0100 Subject: [PATCH] . --- js/main.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/js/main.js b/js/main.js index 114cddd..ec2fa93 100644 --- a/js/main.js +++ b/js/main.js @@ -61,13 +61,17 @@ function retrievePacketList() { * @param {JSON} data - json containing available packets */ async function loadPacketList(data) { - let sessions = await window.db.session.toArray().catch(function(error) { + 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.") - let delete_button = $("").click(()=>{ - window.indexedDB.deleteDatabase("answers_database"); - location.reload(); - }) + $("#database-error").text( + "Error loading the database, schema has probably changed and needs updating. You will probably need to delete the local database." + ); + let delete_button = $("").click( + () => { + window.indexedDB.deleteDatabase("answers_database"); + location.reload(); + } + ); $("#database-error").append(delete_button); $("#database-error").show(); }); @@ -337,7 +341,8 @@ function setUpPacket(data, packet_name) { if (sessions[parseInt(s)].status == "complete") { window.review = true; } - } else { // If cancel is pressed or input is blank + } else { + // If cancel is pressed or input is blank window.aid = uuidv4(); window.date_started = Date.now(); console.log("new date", window.date_started);