Sort feeds

This commit is contained in:
Marcus Noble 2021-02-21 10:34:44 +00:00
parent 22db062fd9
commit 1fc26bfdfe

View File

@ -61,7 +61,7 @@
All ({{unread}}) All ({{unread}})
</div> </div>
<div v-for="feed in feeds" :class="{strong: unreadCounts[feed.ID], 'alert': true, 'alert-success': selectedFeed == feed.ID }" :data-feed="feed.FeedURL" v-on:click="loadFeed(feed.ID)"> <div v-for="feed in sortedFeeds" :class="{strong: unreadCounts[feed.ID], 'alert': true, 'alert-success': selectedFeed == feed.ID }" :data-feed="feed.FeedURL" v-on:click="loadFeed(feed.ID)">
<img :src="feedIcon(feed)" style="height: 16px; width: 16px;" onerror="this.style.visibility = 'hidden'" /> {{feed.Title}} ({{unreadCounts[feed.ID] || '0'}}) <img :src="feedIcon(feed)" style="height: 16px; width: 16px;" onerror="this.style.visibility = 'hidden'" /> {{feed.Title}} ({{unreadCounts[feed.ID] || '0'}})
<div style="float:right"> <div style="float:right">
<button title="Delete Feed" v-on:click="deleteFeed(feed)" :disabled="isBusy"> <button title="Delete Feed" v-on:click="deleteFeed(feed)" :disabled="isBusy">
@ -164,6 +164,9 @@
return this.items.filter(item => item.ID == this.selectedItem || item.FeedID === this.selectedFeed && (!item.Read || item.Read === this.showRead)); return this.items.filter(item => item.ID == this.selectedItem || item.FeedID === this.selectedFeed && (!item.Read || item.Read === this.showRead));
} }
}, },
sortedFeeds() {
return this.feeds.sort((a, b) => a.Title.toLowerCase() > b.Title.toLowerCase());
},
unread() { unread() {
return this.items.filter(item => !item.Read && !item.PendingRead).length; return this.items.filter(item => !item.Read && !item.PendingRead).length;
}, },