diff --git a/src/client/classes/Datastore.js b/src/client/classes/Datastore.js index 89c2751..b18c225 100644 --- a/src/client/classes/Datastore.js +++ b/src/client/classes/Datastore.js @@ -67,6 +67,7 @@ module.exports = class { checkEntry(id){ + this.loadEntry(id); if(!this.map.has(id)){ this.createEntry(id); //this.showEntry(this.getEntry(id)); @@ -85,6 +86,11 @@ module.exports = class { this.saveEntry(id, newData); } + loadEntry(id){ + const json = require(`../../../datastore/` + id + '.json'); + this.map.set(id, json); + } + getEntry(id){ return this.map.get(id); }