Commit dcf9fdef37a0d789731415d11d08d29e777cf1ed
add callback, as sometimes the post showed up as the last post called
Ev Bogue committed on 9/3/2016, 5:44:46 AMParent: f764460e75e9d5babcd1180c26c9ac5ba849ac2d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -33,11 +33,14 @@ | ||
33 | 33 | pull( |
34 | 34 | sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'post'}}}}], limit: 1, reverse: true}), |
35 | 35 | pull.drain(function (data) { |
36 | 36 | post = data; |
37 | + gotPost() | |
37 | 38 | }) |
38 | 39 | ) |
39 | - res.render('profile', {avatar, bloburl, key, markdown, moment}); | |
40 | + function gotPost() { | |
41 | + res.render('profile', {avatar, bloburl, key, markdown, moment}); | |
42 | + } | |
40 | 43 | }) |
41 | 44 | }) |
42 | 45 | }); |
43 | 46 | |
@@ -55,11 +58,14 @@ | ||
55 | 58 | pull( |
56 | 59 | sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'post'}}}}], limit: 1, reverse: true}), |
57 | 60 | pull.drain(function (data) { |
58 | 61 | post = data; |
62 | + gotPost() | |
59 | 63 | }) |
60 | 64 | ) |
61 | - res.render('profile', {avatar, bloburl, key, markdown, moment}); | |
65 | + function gotPost() { | |
66 | + res.render('profile', {avatar, bloburl, key, markdown, moment}); | |
67 | + } | |
62 | 68 | }) |
63 | 69 | }) |
64 | 70 | }); |
65 | 71 |
Built with git-ssb-web