From f5ed933295d5286699848f258f13e7cacc622e8c Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Fri, 16 Nov 2018 13:10:05 -0500 Subject: [PATCH] Attempting workaround to fix #68 --- routes/baseActionsRouter.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index 6351082..9efe2e8 100644 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -714,10 +714,7 @@ router.get("/address/:address", function(req, res) { })); } - Promise.all(promises).catch(function(err) { - console.log("Error 32197rgh327g2: " + err + ", error json: " + JSON.stringify(err)); - - }).finally(function() { + promises.push(new Promise(function(resolve, reject) { qrcode.toDataURL(address, function(err, url) { if (err) { console.log("Error 93ygfew0ygf2gf2: " + err); @@ -725,8 +722,17 @@ router.get("/address/:address", function(req, res) { res.locals.addressQrCodeUrl = url; - res.render("address"); + resolve(); }); + })); + + Promise.all(promises).then(function() { + res.render("address"); + + }).catch(function(err) { + console.log("Error 32197rgh327g2: " + err + ", error json: " + JSON.stringify(err)); + + res.render("address"); }); }).catch(function(err) {