Customisation of default profile tab, clean up settings (#156)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk> Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/156
This commit is contained in:
parent
c301daa276
commit
ae1b6ad887
7 changed files with 54 additions and 47 deletions
|
@ -33,22 +33,21 @@ const FriendList = withLoadMore({
|
|||
additionalPropNames: ['userId']
|
||||
})(List)
|
||||
|
||||
const defaultTabKey = 'statuses'
|
||||
|
||||
const UserProfile = {
|
||||
data () {
|
||||
return {
|
||||
error: false,
|
||||
userId: null,
|
||||
tab: defaultTabKey,
|
||||
tab: 'statuses',
|
||||
footerRef: null,
|
||||
note: null,
|
||||
noteLoading: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
const defaultTabKey = this.defaultTabKey
|
||||
const routeParams = this.$route.params
|
||||
const hash = get(this.$route, 'hash', defaultTabKey).replace(/^#/, '')
|
||||
const hash = (get(this.$route, 'hash') || defaultTabKey).replace(/^#/, '')
|
||||
if (hash !== '') this.tab = hash
|
||||
this.load(routeParams.name || routeParams.id)
|
||||
},
|
||||
|
@ -86,6 +85,9 @@ const UserProfile = {
|
|||
},
|
||||
currentUser () {
|
||||
return this.$store.state.users.currentUser
|
||||
},
|
||||
defaultTabKey () {
|
||||
return this.$store.getters.mergedConfig.userProfileDefaultTab || 'statuses'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -191,7 +193,7 @@ const UserProfile = {
|
|||
},
|
||||
'$route.hash': function (newVal) {
|
||||
const oldTab = this.tab
|
||||
this.tab = newVal.replace(/^#/, '') || defaultTabKey
|
||||
this.tab = newVal.replace(/^#/, '') || this.defaultTabKey
|
||||
this.onRouteChange(oldTab, this.tab)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue