git ssb

30+

cel / git-ssb-web



Commit 475e344db407a8f7d1b682b4cc3866f09f5131e3

Fix readOnce

Inner function was getting called twice
cel committed on 5/1/2020, 5:14:46 PM
Parent: 92589aebf8f4f4f91d38ee6062b424ed041c7f34

Files changed

lib/util.jschanged
lib/util.jsView
@@ -36,12 +36,12 @@
3636
3737 u.readOnce = function (fn) {
3838 var ended
3939 return function (end, cb) {
40 + if (ended) return cb(ended)
4041 fn(function (err, data) {
41- if (err || ended) return cb(err || ended)
42- ended = true
43- cb(null, data)
42 + ended = err || true
43 + cb(err, data)
4444 })
4545 }
4646 }
4747

Built with git-ssb-web