From eaf83bffb0b999f5f23596f5df992fcc243cb4cf Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 18 Oct 2020 16:33:23 +0900 Subject: [PATCH] =?UTF-8?q?LTL=20/=20GTL=E3=81=8C=E7=84=A1=E5=8A=B9?= =?UTF-8?q?=E3=81=A7=E3=82=82=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/pages/timeline.vue | 76 +++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/src/client/pages/timeline.vue b/src/client/pages/timeline.vue index a15d57e37e..cefcf54b6d 100644 --- a/src/client/pages/timeline.vue +++ b/src/client/pages/timeline.vue @@ -49,47 +49,63 @@ export default defineComponent({ menuOpened: false, queue: 0, width: 0, - INFO: { - header: [{ + INFO: computed(() => { + const header = [{ id: 'home', title: null, tooltip: this.$t('_timelines.home'), icon: faHome, onClick: () => { this.src = 'home'; this.saveSrc(); }, selected: computed(() => this.src === 'home') - }, { - id: 'local', - title: null, - tooltip: this.$t('_timelines.local'), - icon: faComments, - onClick: () => { this.src = 'local'; this.saveSrc(); }, - selected: computed(() => this.src === 'local') - }, { - id: 'social', - title: null, - tooltip: this.$t('_timelines.social'), - icon: faShareAlt, - onClick: () => { this.src = 'social'; this.saveSrc(); }, - selected: computed(() => this.src === 'social') - }, { - id: 'global', - title: null, - tooltip: this.$t('_timelines.global'), - icon: faGlobe, - onClick: () => { this.src = 'global'; this.saveSrc(); }, - selected: computed(() => this.src === 'global') - }, { + }]; + + if (!this.$store.state.instance.meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin) { + header.push({ + id: 'local', + title: null, + tooltip: this.$t('_timelines.local'), + icon: faComments, + onClick: () => { this.src = 'local'; this.saveSrc(); }, + selected: computed(() => this.src === 'local') + }); + + header.push({ + id: 'social', + title: null, + tooltip: this.$t('_timelines.social'), + icon: faShareAlt, + onClick: () => { this.src = 'social'; this.saveSrc(); }, + selected: computed(() => this.src === 'social') + }); + } + + if (!this.$store.state.instance.meta.disableGlobalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin) { + header.push({ + id: 'global', + title: null, + tooltip: this.$t('_timelines.global'), + icon: faGlobe, + onClick: () => { this.src = 'global'; this.saveSrc(); }, + selected: computed(() => this.src === 'global') + }); + } + + header.push({ id: 'other', title: null, icon: faEllipsisH, onClick: this.choose, indicate: computed(() => this.$store.state.i.hasUnreadAntenna || this.$store.state.i.hasUnreadChannel) - }], - action: { - icon: faPencilAlt, - handler: () => os.post() - } - }, + }); + + return { + header, + action: { + icon: faPencilAlt, + handler: () => os.post() + } + }; + }), faAngleDown, faAngleUp, faHome, faShareAlt, faGlobe, faComments, faListUl, faSatellite, faSatelliteDish, faCircle }; },