mirror of
https://github.com/basicswap/basicswap.git
synced 2025-05-04 20:02:30 +00:00
ui: Fix notifications.
This commit is contained in:
parent
3c2eb5f9f8
commit
a9f3eeefff
2 changed files with 10 additions and 1 deletions
basicswap
|
@ -1034,7 +1034,7 @@ class BasicSwap(BaseApp):
|
||||||
def getNotifications(self):
|
def getNotifications(self):
|
||||||
rv = []
|
rv = []
|
||||||
for k, v in self._notifications_cache.items():
|
for k, v in self._notifications_cache.items():
|
||||||
rv.append((time.strftime('%d-%m-%y %H:%M:%S', time.localtime(k)), int(v[0]), json.dumps(v[1])))
|
rv.append((time.strftime('%d-%m-%y %H:%M:%S', time.localtime(k)), int(v[0]), v[1]))
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
def vacuumDB(self):
|
def vacuumDB(self):
|
||||||
|
|
|
@ -682,6 +682,15 @@
|
||||||
|
|
||||||
{% for entry in notifications %}
|
{% for entry in notifications %}
|
||||||
console.log({{ entry[0] }}, {{ entry[1] }}, {{ entry[2] }});
|
console.log({{ entry[0] }}, {{ entry[1] }}, {{ entry[2] }});
|
||||||
|
{% if entry[1] == 1 %}
|
||||||
|
console.log('new_offer {{ entry[2].offer_id }}');
|
||||||
|
{% elif entry[1] == 2 %}
|
||||||
|
console.log('new_bid {{ entry[2].bid_id }} on {{ entry[2].offer_id }}');
|
||||||
|
{% elif entry[1] == 3 %}
|
||||||
|
console.log('bid_accepted {{ entry[2].bid_id }}');
|
||||||
|
{% else %}
|
||||||
|
console.log('Unknown event {{ entry[1] }}');
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue