Skip to content

Commit

Permalink
Add clear function in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
yumata committed Nov 25, 2023
1 parent 999d02d commit 0d9c199
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions app.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -12297,6 +12297,32 @@
deleteRequest.onsuccess = resolve;
});
}
}, {
key: "clearTable",
value: function clearTable(store_name) {
var _this8 = this;

return new Promise(function (resolve, reject) {
if (!_this8.db) {
return _this8.log('Database not open', store_name, key), reject('Database not open');
}

var transaction = _this8.db.transaction([store_name], 'readwrite');

var objectStore = transaction.objectStore(store_name);
var clearRequest = objectStore.clear();

clearRequest.onerror = function (event) {
_this8.log(clearRequest.error || 'An error occurred while clearing the table', store_name);

reject(clearRequest.error || 'An error occurred while clearing the table');
};

clearRequest.onsuccess = function () {
resolve();
};
});
}
}]);

return IndexedDB;
Expand Down Expand Up @@ -15180,13 +15206,13 @@
}
}

function key() {
function key$1() {
return '4ef0d7355d9ffb5151e987764708ce96';
}

var TMDB$1 = {
api: api$2,
key: key,
key: key$1,
image: image,
broken: broken
};
Expand Down

0 comments on commit 0d9c199

Please sign in to comment.