Skip to content

Commit

Permalink
lastId should return an array if there was a concurrent update to the…
Browse files Browse the repository at this point in the history
… thread (#18)
  • Loading branch information
dominictarr authored and ahdinosaur committed Jun 3, 2017
1 parent 654a3be commit 983320c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions feed/obs/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ exports.create = function (api) {
var result = {
messages,
lastId: computed(messages, (messages) => {
var last = messages[messages.length - 1]
if (last) return last.key
var branches = sort.heads(messages)
if(branches.length <= 1) branches = branches[0]
return branches
}),
rootId: computed(messages, (messages) => {
if (branch && messages.length) {
Expand Down

0 comments on commit 983320c

Please sign in to comment.