|
|
@ -31,6 +31,66 @@ library.add(
|
|
|
|
faList
|
|
|
|
faList
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const TIMELINES = {
|
|
|
|
|
|
|
|
home: {
|
|
|
|
|
|
|
|
route: 'friends',
|
|
|
|
|
|
|
|
anonRoute: 'public-timeline',
|
|
|
|
|
|
|
|
icon: 'home',
|
|
|
|
|
|
|
|
label: 'nav.home_timeline',
|
|
|
|
|
|
|
|
criteria: ['!private']
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
public: {
|
|
|
|
|
|
|
|
route: 'public-timeline',
|
|
|
|
|
|
|
|
anon: true,
|
|
|
|
|
|
|
|
icon: 'users',
|
|
|
|
|
|
|
|
label: 'nav.public_tl',
|
|
|
|
|
|
|
|
criteria: ['!private']
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
twkn: {
|
|
|
|
|
|
|
|
route: 'public-external-timeline',
|
|
|
|
|
|
|
|
anon: true,
|
|
|
|
|
|
|
|
icon: 'globe',
|
|
|
|
|
|
|
|
label: 'nav.twkn',
|
|
|
|
|
|
|
|
criteria: ['!private', 'federating']
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
bookmarks: {
|
|
|
|
|
|
|
|
route: 'bookmarks',
|
|
|
|
|
|
|
|
icon: 'bookmark',
|
|
|
|
|
|
|
|
label: 'nav.bookmarks'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
dms: {
|
|
|
|
|
|
|
|
route: 'dms',
|
|
|
|
|
|
|
|
icon: 'envelope',
|
|
|
|
|
|
|
|
label: 'nav.dms'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export const ROOT_ITEMS = {
|
|
|
|
|
|
|
|
interactions: {
|
|
|
|
|
|
|
|
route: 'interactions',
|
|
|
|
|
|
|
|
icon: 'bell',
|
|
|
|
|
|
|
|
label: 'nav.interactions'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
chats: {
|
|
|
|
|
|
|
|
route: 'chats',
|
|
|
|
|
|
|
|
icon: 'comments',
|
|
|
|
|
|
|
|
label: 'nav.chats',
|
|
|
|
|
|
|
|
badgeGetter: 'unreadChatCount'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
friendRequests: {
|
|
|
|
|
|
|
|
route: 'friend-requests',
|
|
|
|
|
|
|
|
icon: 'user-plus',
|
|
|
|
|
|
|
|
label: 'nav.friend_requests',
|
|
|
|
|
|
|
|
criteria: ['lockedUser'],
|
|
|
|
|
|
|
|
badgeGetter: 'followRequestCount'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
about: {
|
|
|
|
|
|
|
|
route: 'about',
|
|
|
|
|
|
|
|
anon: true,
|
|
|
|
|
|
|
|
icon: 'info-circle',
|
|
|
|
|
|
|
|
label: 'nav.about'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const NavPanel = {
|
|
|
|
const NavPanel = {
|
|
|
|
created () {
|
|
|
|
created () {
|
|
|
|
if (this.currentUser && this.currentUser.locked) {
|
|
|
|
if (this.currentUser && this.currentUser.locked) {
|
|
|
@ -43,8 +103,11 @@ const NavPanel = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
collapsed: false,
|
|
|
|
showTimelines: false,
|
|
|
|
showTimelines: false,
|
|
|
|
showLists: false
|
|
|
|
showLists: false,
|
|
|
|
|
|
|
|
timelinesList: Object.entries(TIMELINES).map(([k, v]) => ({ ...v, name: k })),
|
|
|
|
|
|
|
|
rootList: Object.entries(ROOT_ITEMS).map(([k, v]) => ({ ...v, name: k }))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
@ -53,19 +116,57 @@ const NavPanel = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toggleLists () {
|
|
|
|
toggleLists () {
|
|
|
|
this.showLists = !this.showLists
|
|
|
|
this.showLists = !this.showLists
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
toggleCollapse () {
|
|
|
|
|
|
|
|
this.collapsed = !this.collapsed
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isPinned (item) {
|
|
|
|
|
|
|
|
return this.pinnedItems.has(item)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
togglePin (item) {
|
|
|
|
|
|
|
|
if (this.isPinned(item)) {
|
|
|
|
|
|
|
|
this.$store.commit('removeCollectionPreference', { path: 'collections.pinnedNavItems', value: item })
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$store.commit('addCollectionPreference', { path: 'collections.pinnedNavItems', value: item })
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
listsNavigation () {
|
|
|
|
|
|
|
|
return this.$store.getters.mergedConfig.listsNavigation
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
...mapState({
|
|
|
|
...mapState({
|
|
|
|
currentUser: state => state.users.currentUser,
|
|
|
|
currentUser: state => state.users.currentUser,
|
|
|
|
followRequestCount: state => state.api.followRequests.length,
|
|
|
|
followRequestCount: state => state.api.followRequests.length,
|
|
|
|
privateMode: state => state.instance.private,
|
|
|
|
privateMode: state => state.instance.private,
|
|
|
|
federating: state => state.instance.federating,
|
|
|
|
federating: state => state.instance.federating,
|
|
|
|
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
|
|
|
|
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable,
|
|
|
|
|
|
|
|
pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems)
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
rootItems () {
|
|
|
|
|
|
|
|
return Object
|
|
|
|
|
|
|
|
.entries({ ...ROOT_ITEMS })
|
|
|
|
|
|
|
|
.map(([k, v]) => ({ ...v, name: k }))
|
|
|
|
|
|
|
|
.filter(({ criteria, anon, anonRoute }) => {
|
|
|
|
|
|
|
|
const set = new Set(criteria || [])
|
|
|
|
|
|
|
|
if (!this.federating && set.has('federating')) return false
|
|
|
|
|
|
|
|
if (this.private && set.has('!private')) return false
|
|
|
|
|
|
|
|
if (!this.currentUser && !(anon || anonRoute)) return false
|
|
|
|
|
|
|
|
if ((!this.currentUser || !this.currentUser.locked) && set.has('lockedUser')) return false
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
pinnedList () {
|
|
|
|
|
|
|
|
return Object
|
|
|
|
|
|
|
|
.entries({ ...TIMELINES, ...ROOT_ITEMS })
|
|
|
|
|
|
|
|
.filter(([k]) => this.pinnedItems.has(k))
|
|
|
|
|
|
|
|
.map(([k, v]) => ({ ...v, name: k }))
|
|
|
|
|
|
|
|
.filter(({ criteria, anon, anonRoute }) => {
|
|
|
|
|
|
|
|
const set = new Set(criteria || [])
|
|
|
|
|
|
|
|
if (!this.federating && set.has('federating')) return false
|
|
|
|
|
|
|
|
if (this.private && set.has('!private')) return false
|
|
|
|
|
|
|
|
if (!this.currentUser && !(anon || anonRoute)) return false
|
|
|
|
|
|
|
|
if (this.currentUser && !this.currentUser.locked && set.has('locked')) return false
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
...mapGetters(['unreadChatCount'])
|
|
|
|
...mapGetters(['unreadChatCount'])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|