   @reviewFilter.set(null)
   @selectedSourceId = new ReactiveVar(null)
   @query = new ReactiveVar(null)
+  @sorting = new ReactiveVar(null)
   @currentPaneInView = new ReactiveVar('')
   @latestSourceDate = new ReactiveVar(null)
   @filtering = new ReactiveVar(false)


Template.curatorInbox.helpers
  articles: ->
    Articles.find()

  days: ->
    {startDate, endDate} = Template.instance().dateRange.get()

    dateQuery =
      $gte: new Date(startDate)
      $lte: new Date(endDate)
    sorting = sort: publishDate: -1
    if query.addedByUserId
      sorting = sort: addedDate: -1
      query.addedDate = dateQuery
    else
      query.publishDate = dateQuery

    @sorting.set(sorting)

    @query.set(query)

    Meteor.call 'fetchPromedPosts', 100, range, (err) ->
