From 37a755025d6f1791037b17f38ca441757cba496e Mon Sep 17 00:00:00 2001 From: randogoth Date: Mon, 22 May 2023 12:00:25 +0300 Subject: [PATCH] debug --- userdb/db.py | 2 +- web/nfc-theme/static/user.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/userdb/db.py b/userdb/db.py index 0f61ba4..da3582a 100644 --- a/userdb/db.py +++ b/userdb/db.py @@ -50,6 +50,6 @@ def track(): return str(len(db[hash][cat])) else: - return 'hash missing' + return str(0) serve(app, host='0.0.0.0', port=8001) \ No newline at end of file diff --git a/web/nfc-theme/static/user.js b/web/nfc-theme/static/user.js index b07297c..9fcb836 100644 --- a/web/nfc-theme/static/user.js +++ b/web/nfc-theme/static/user.js @@ -30,8 +30,12 @@ fetch('https://nmns.place/track?' + new URLSearchParams({ ua: ua, cat: cat })).then(response => response.text().then((progress) => { - total = document.querySelector('span#progress').innerHTML - document.querySelector('span#progress').innerHTML = progress + ' of ' + total + if ( progress != '0') { + total = document.querySelector('span#progress').innerHTML + document.querySelector('span#progress').innerHTML = progress + ' of ' + total + } else { + document.querySelector('span#progress').innerHTML = 'anonymous' + } })) .catch(error => { // handle the error