From df48018ce86c1567a771700b53f66612f72db4f5 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 2 Nov 2021 03:08:20 +0530 Subject: [PATCH] Implement full configuration of homepage --- src/App.vue | 40 ++++++++++++++++++++++---------------- src/routes/FeedPage.vue | 23 +++++++++++++++++----- src/routes/Preferences.vue | 32 +++++++++++++++--------------- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4dfc31f..69b35e1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -96,23 +96,6 @@ export default { }, data: () => ({ - links: [ - { - id: 'prefs', - name: 'titles.preferences', - to: '/preferences' - }, - { - id: 'trending', - name: 'titles.trending', - to: '/' - }, - { - id: 'watch-history', - name: 'titles.history', - to: '/watch-history' - } - ], languageOptions: [ { value: 'zh_Hant', text: 'Chinese (Traditional)' }, { value: 'en', text: 'English' }, @@ -132,11 +115,34 @@ export default { drawer: false }), + computed: { + links () { + return [ + { + id: 'prefs', + name: 'titles.preferences', + to: '/preferences' + }, + { + id: 'trending', + name: 'titles.' + this.$store.getters['prefs/getPreference']('homepage', 'trending'), + to: '/' + }, + { + id: 'watch-history', + name: 'titles.history', + to: '/watch-history' + } + ] + } + }, + methods: { changeLocale (lang) { return changeLocale(lang) } }, + created () { this.$store.dispatch('prefs/loadState') this.$store.dispatch('auth/initializeAuth') diff --git a/src/routes/FeedPage.vue b/src/routes/FeedPage.vue index 979688b..215694b 100644 --- a/src/routes/FeedPage.vue +++ b/src/routes/FeedPage.vue @@ -1,6 +1,6 @@