git ssb

0+

Piet / ssb-loomio



Commit ec85adadd27d70bb0aacbb5163e3925552cb8dd1

Syncs obs when pull-stream emits sync.

Piet Geursen committed on 5/14/2018, 8:07:58 AM
Parent: 20e2c40722bb439146e13f50e9c4c2e6811ab141

Files changed

poll/obs/get.jschanged
poll/obs/get.jsView
@@ -90,10 +90,19 @@
9090 createBacklinkStream(key),
9191 pull.drain(refs)
9292 )
9393
94+ //don't sync obs until we got sync from the stream to save some renders.
9495 pull(
9596 refs.listen(),
97+ pull.filter(ref => ref.sync),
98+ pull.drain(() => {
99+ pollDoc.sync.set(true)
100+ })
101+ )
102+
103+ pull(
104+ refs.listen(),
96105 pull.filter(isPosition[CHOOSE_ONE]), // TODO: this shouldn't be hard coded
97106 pull.map(position => {
98107 return decoratePosition({position, poll})
99108 }),
@@ -114,10 +123,8 @@
114123 pull.filter(isPosition[CHOOSE_ONE]),
115124 pull.filter(position => position.value.author === myKey),
116125 pull.drain(mine => myPositions.push(mine))
117126 )
118-
119- pollDoc.sync.set(true)
120127 })
121128 })
122129 return pollDoc
123130 }

Built with git-ssb-web