Move anti-caching parameter to load function

For less repetition and shorter paths in the higher level functions.
Active by default, but can be disabled.
This commit is contained in:
Dominik Reh
2023-02-10 11:59:06 +01:00
parent cbeced9121
commit d29298e0cc
7 changed files with 16 additions and 13 deletions

View File

@@ -38,7 +38,10 @@ function parseCSV(str) {
}
// Load file
async function readFile(filePath, json = false) {
async function readFile(filePath, json = false, cache = false) {
if (!cache)
filePath += `?${new Date().getTime()}`;
let response = await fetch(`file=${filePath}`);
if (response.status != 200) {