From b3e0391f53d98b777d6cdb21ba0492c31927a6f0 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Fri, 22 Jan 2016 22:43:39 +0100 Subject: ordering feeds --- src/web/js/components/Menu.react.js | 3 +++ src/web/views/views.py | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/web/js/components/Menu.react.js b/src/web/js/components/Menu.react.js index ef0ec274..7f5f17bc 100644 --- a/src/web/js/components/Menu.react.js +++ b/src/web/js/components/Menu.react.js @@ -46,10 +46,13 @@ var Category = React.createClass({ }, render: function() { var filter = this.props.filter; + // filtering according to this.props.filter var feeds = this.props.feeds.filter(function(feed) { if (filter == 'unread' && feed.unread <= 0) {return false;} else if (filter == 'error' && feed.error_count <= 3){return false;} return true; + }).sort(function(feed_a, feed_b){ + return feed_b.unread - feed_a.unread; }).map(function(feed) { return (