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