ssbc / patchcore

A shared library of depject modules to build Secure Scuttlebutt social network apps
GNU Affero General Public License v3.0
74 stars 17 forks source link

ammending #56 - fix preserving partial re-rendering from messages #57

Closed mmckegg closed 6 years ago

mmckegg commented 6 years ago

Also, this fixes thread.lastMessage which was broken in #56 by changing thread.messages back into an array like observable.

The previous PR had swapped out a concat (array like/collection with indexOf, etc) with a computed (flat object). This was a breaking API change, and it also broke the system for avoiding re-rendering the entire thread in patchwork whenever a new message was added.

This PR fixes this by switching back to concat, and then moving the sort logic into the reply sorting. Haven't tested on a thread that is out of order yet. I'll leave that as an exercise for you @mixmix (I have to catch a flight soon!)