Commit 89f2b668 authored by Sean Hammond's avatar Sean Hammond

Show all annotations on the stream page

The stream page was broken - showing only annotations from the group
that was focused the last time the user was using the sidebar.

Fix it to show annotations from all groups.
parent 381371df
......@@ -158,8 +158,14 @@ describe 'thread', ->
id: 123
group: 'wibble'
it 'is false when the focused group does not match', ->
it 'is false for draft annotations not from the focused group', ->
# Set the focused group to one other than the annotation's group.
fakeGroups.focused.returns({id: 'foo'})
# Make the annotation into a "draft" annotation (make isNew() return
# true).
delete controller.container.message.id
assert.isFalse(controller.shouldShow())
it 'is true when the focused group does match', ->
......
......@@ -44,11 +44,12 @@ ThreadController = [
# current system state.
###
this.shouldShow = ->
# If the annotation has a group set, then hide it if it doesn't belong to
# the focused group. This is mainly important for drafts, which are
# persisted across route reloads.
# Hide "draft" annotations (new annotations that haven't been saved to
# the server yet) that don't belong to the focused group. These draft
# annotations persist across route reloads so they have to be hidden
# here.
group = this.container?.message?.group
if group and group != groups.focused().id
if this.isNew() and group and group != groups.focused().id
return false
if this.container?.message?.$orphan == true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment