From c270f0392a7df4b1b0985bcf584272e373b52a74 Mon Sep 17 00:00:00 2001 From: Ex Inferi Date: Thu, 7 Nov 2024 18:07:17 +0100 Subject: [PATCH] Fix scope issue for fetching materials --- scripts/data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/data.js b/scripts/data.js index 28850d5..8c2273d 100644 --- a/scripts/data.js +++ b/scripts/data.js @@ -58,10 +58,10 @@ async function getMatsfromWiki() { } async function checkSaveMats() { + // Add new mats from wiki if they don't exist in LocalStorage. + let materials = await getMatsfromWiki(); if (localStorage.getItem("archMats") != null) { const saveData = JSON.parse(localStorage.archMats); - // Add new mats from wiki if they don't exist in LocalStorage. - let materials = await getMatsfromWiki(); materials.forEach((mat, i) => { if (!saveData[i]) { console.debug("Adding new Material: " + mat.name);