Merge remote-tracking branch 'upstream/develop' into birthdays

This commit is contained in:
tusooa 2023-01-22 09:34:01 -05:00
commit b1e75c25bd
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
300 changed files with 13879 additions and 9055 deletions

View file

@ -48,7 +48,7 @@ const UserProfile = {
},
created () {
const routeParams = this.$route.params
this.load(routeParams.name || routeParams.id)
this.load({ name: routeParams.name, id: routeParams.id })
this.tab = get(this.$route, 'query.tab', defaultTabKey)
},
unmounted () {
@ -113,12 +113,17 @@ const UserProfile = {
this.userId = null
this.error = false
const maybeId = userNameOrId.id
const maybeName = userNameOrId.name
// Check if user data is already loaded in store
const user = this.$store.getters.findUser(userNameOrId)
const user = maybeId ? this.$store.getters.findUser(maybeId) : this.$store.getters.findUserByName(maybeName)
if (user) {
loadById(user.id)
} else {
this.$store.dispatch('fetchUser', userNameOrId)
(maybeId
? this.$store.dispatch('fetchUser', maybeId)
: this.$store.dispatch('fetchUserByName', maybeName))
.then(({ id }) => loadById(id))
.catch((reason) => {
const errorMessage = get(reason, 'error.error')
@ -157,12 +162,12 @@ const UserProfile = {
watch: {
'$route.params.id': function (newVal) {
if (newVal) {
this.switchUser(newVal)
this.switchUser({ id: newVal })
}
},
'$route.params.name': function (newVal) {
if (newVal) {
this.switchUser(newVal)
this.switchUser({ name: newVal })
}
},
'$route.query': function (newVal) {

View file

@ -10,6 +10,7 @@
:selected="timeline.viewing"
avatar-action="zoom"
rounded="top"
:has-note-editor="true"
/>
<span
v-if="!!user.birthday"
@ -149,7 +150,7 @@
<script src="./user_profile.js"></script>
<style lang="scss">
@import '../../_variables.scss';
@import "../../variables";
.user-profile {
flex: 2;
@ -199,7 +200,8 @@
margin: 0 0 0 0.25em;
}
.user-profile-field-name, .user-profile-field-value {
.user-profile-field-name,
.user-profile-field-value {
line-height: 1.3;
text-overflow: ellipsis;
white-space: nowrap;
@ -217,6 +219,7 @@
padding: 2em;
}
}
.user-profile-placeholder {
.panel-body {
display: flex;