quick patch fixing new user login

This commit is contained in:
Expand-sys 2021-06-11 09:04:53 +10:00
parent ec3ec448f2
commit a1f37f44a6

View file

@ -210,7 +210,9 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
logsent = logsent.body.value; logsent = logsent.body.value;
let logrec = logsent; let logrec = logsent;
let graphlog = logsent; let graphlog = logsent;
if (graphlog != null) {
graphlog = graphlog.reverse(); graphlog = graphlog.reverse();
}
let graphdata = ""; let graphdata = "";
let currentbal = balance.value; let currentbal = balance.value;
if (graphlog) { if (graphlog) {
@ -226,10 +228,14 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
} else { } else {
graphlog = undefined; graphlog = undefined;
} }
if (graphdata != "") {
graphdata = graphdata =
", [" + parseInt(graphlog.length) + "," + balance.value + "]" + graphdata; ", [" + parseInt(graphlog.length) + "," + balance.value + "]" + graphdata;
console.log(balance);
graphdata = '["transaction", "balance"]' + graphdata; graphdata = '["transaction", "balance"]' + graphdata;
}
console.log(balance);
console.log(JSON.stringify(graphdata)); console.log(JSON.stringify(graphdata));
if (logsent == 1 || logsent == -1 || logsent == null) { if (logsent == 1 || logsent == -1 || logsent == null) {
logsent = undefined; logsent = undefined;
@ -251,6 +257,12 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
logsent[i].time = new Date(logsent[i].time); logsent[i].time = new Date(logsent[i].time);
} }
} }
if (logrec != null) {
logrec.reverse();
}
if (logsent != null) {
logsent.reverse();
}
let maxgraph = balance + 1000; let maxgraph = balance + 1000;
console.log("begin render " + Date.now()); console.log("begin render " + Date.now());
res.render("bankf", { res.render("bankf", {