diff --git a/src/components/FeedPage.vue b/src/components/FeedPage.vue index 7ebc73ae..90d505be 100644 --- a/src/components/FeedPage.vue +++ b/src/components/FeedPage.vue @@ -6,6 +6,15 @@
View Subscriptions +
+ Sort by: + +
@@ -31,6 +40,7 @@ export default { data() { return { videos: [], + selectedSort: "descending", }; }, mounted() { @@ -45,6 +55,22 @@ export default { authToken: this.getAuthToken(), }); }, + onChange() { + switch (this.selectedSort) { + case "ascending": + this.videos.sort((a, b) => a.uploaded - b.uploaded); + break; + case "descending": + this.videos.sort((a, b) => b.uploaded - a.uploaded); + break; + case "channel_ascending": + this.videos.sort((a, b) => a.uploaderName.localeCompare(b.uploaderName)); + break; + case "channel_descending": + this.videos.sort((a, b) => b.uploaderName.localeCompare(a.uploaderName)); + break; + } + }, }, computed: { getRssUrl(_this) {