.
This commit is contained in:
+21
-14
@@ -2561,11 +2561,7 @@ $(".start-packet-button").click(function(evt) {
|
||||
$.modal.close();
|
||||
});
|
||||
|
||||
$("#btn-delete-answer-databases").click(function(evt) {
|
||||
var r = confirm(
|
||||
"This will delete ALL saved answers (including saved correct answers)!"
|
||||
);
|
||||
if (r == true) {
|
||||
function delete_answer_db() {
|
||||
db.delete()
|
||||
.then(() => {
|
||||
$.notify("Database successfully deleted", "success");
|
||||
@@ -2582,11 +2578,9 @@ $("#btn-delete-answer-databases").click(function(evt) {
|
||||
.finally(() => {
|
||||
// Do what should be done next...
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
$("#btn-delete-cached-questions").click(function(evt) {
|
||||
var r = confirm("Delete cached questions?");
|
||||
if (r == true) {
|
||||
}
|
||||
|
||||
function delete_question_db() {
|
||||
question_db
|
||||
.delete()
|
||||
.then(() => {
|
||||
@@ -2604,15 +2598,28 @@ $("#btn-delete-cached-questions").click(function(evt) {
|
||||
.finally(() => {
|
||||
// Do what should be done next...
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$("#btn-delete-answer-databases").click(function(evt) {
|
||||
var r = confirm(
|
||||
"This will delete ALL saved answers (including saved correct answers)!"
|
||||
);
|
||||
if (r == true) {
|
||||
delete_answer_db();
|
||||
} else {}
|
||||
});
|
||||
$("#btn-delete-cached-questions").click(function(evt) {
|
||||
var r = confirm("Delete cached questions?");
|
||||
if (r == true) {
|
||||
delete_question_db();
|
||||
} else {}
|
||||
});
|
||||
$("#btn-reset-local").click(function(evt) {
|
||||
var r = confirm("Clear all local data");
|
||||
if (r == true) {
|
||||
(async () => {
|
||||
const dbs = await window.indexedDB.databases();
|
||||
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) });
|
||||
})();
|
||||
delete_answer_db();
|
||||
delete_question_db();
|
||||
} else {}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user