Skip to content

Commit

Permalink
Fix error on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Durtur committed Oct 4, 2023
1 parent 1a1df15 commit d473b98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/js/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,13 +974,14 @@ function getRandomEncounter() {
}

function deleteFromHomebrew(toRemove) {
readDataFunction(function (data) {
readDataFunction(async function (data) {
//Find index of first
var index = indexOfId(data, toRemove);
if (index == -1) return false;
data.splice(index, 1);
if (tab == "monsters" || tab == "homebrew") {
var tokens = getAllTokenPaths(toRemove);
console.log(toRemove)
var tokens = await dataAccess.getTokenPaths(toRemove);
tokens.forEach((token) => {
fs.unlink(token, function (err) {
if (err) console.log(err);
Expand Down

0 comments on commit d473b98

Please sign in to comment.