🤦 Fix report data being assigned to the same object.
This commit is contained in:
parent
eced93fdef
commit
8bdcd2c444
1 changed files with 5 additions and 14 deletions
|
@ -3,22 +3,9 @@
|
||||||
const app = document.getElementById("appContent");
|
const app = document.getElementById("appContent");
|
||||||
let userdata;
|
let userdata;
|
||||||
load();
|
load();
|
||||||
const emptyPages = {
|
|
||||||
"title": {"type": "title"},
|
|
||||||
"blank": {"type": "blank"},
|
|
||||||
"report": {
|
|
||||||
"type": "report",
|
|
||||||
"days": [ [], [], [], [], [], ],
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
let templates;
|
let templates;
|
||||||
|
|
||||||
// const templates = {
|
|
||||||
// "blank": (await fetchTemplate("blank"))
|
|
||||||
// };
|
|
||||||
// let blank = fetchTemplate("blank").then(b=>{blank=b});
|
|
||||||
// let blank = fetchTemplate("blank")
|
|
||||||
async function init() {
|
async function init() {
|
||||||
if (typeof templates === "undefined") {
|
if (typeof templates === "undefined") {
|
||||||
templates = {
|
templates = {
|
||||||
|
@ -39,7 +26,11 @@ async function init() {
|
||||||
|
|
||||||
function pageAdd(template) {
|
function pageAdd(template) {
|
||||||
pageNew(template);
|
pageNew(template);
|
||||||
userdata.pages.push(emptyPages[template]);
|
let newPage = {"type": template};
|
||||||
|
if (template === "report") {
|
||||||
|
newPage["days"] = [ [], [], [], [], [], ];
|
||||||
|
}
|
||||||
|
userdata.pages.push(newPage);
|
||||||
populate(app.children.length);
|
populate(app.children.length);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue