aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv Bogue <ev@evbogue.com>2019-05-22 13:35:17 -0500
committerEv Bogue <ev@evbogue.com>2019-05-22 13:35:17 -0500
commit28e2fc486558f45b6b62ba1216e69314ec2bb07e (patch)
treecf9a0b5a29efa8694b280d6f10a349c0a9eb516e
parent397482994f74fed3fc0929d369bd87d3ee89ad2b (diff)
render latest name instead of the first name you used to identify
-rw-r--r--bog.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/bog.js b/bog.js
index 74b7d05..6dd2811 100644
--- a/bog.js
+++ b/bog.js
@@ -60,11 +60,12 @@ function getName (id) {
name.textContent = id.substring(0, 10) + '...'
bog().then(log => {
- log.forEach(function (msg) {
- if (msg.named == id) {
- return name.textContent = '@' + msg.name
- }
- })
+ for (var i = 0; i < log.length; i++ ) {
+ if (log[i].named == id) {
+ console.log(log[i].name)
+ return name.textContent = '@' + log[i].name
+ }
+ }
})
return name