i have no idea how this worked before, but now it does fr

This commit is contained in:
Henry Jameson 2025-08-04 14:22:20 +03:00
commit 86f8f46b95

View file

@ -92,7 +92,7 @@ export default {
ImageCropper ImageCropper
}, },
data () { data () {
const user = this.$store.state.users.currentUser const user = this.$store.getters.findUser(this.userId)
return { return {
followRequestInProgress: false, followRequestInProgress: false,
@ -113,7 +113,7 @@ export default {
newBirthday: user.birthday, newBirthday: user.birthday,
newShowBirthday: user.show_birthday, newShowBirthday: user.show_birthday,
newCoverPhoto: user.cover_photo, newCoverPhoto: user.cover_photo,
newFields: user.fields.map(field => ({ name: field.name, value: field.value })), newFields: user.fields?.map(field => ({ name: field.name, value: field.value })),
editingFields: false, editingFields: false,
newShowRole: user.show_role, newShowRole: user.show_role,
} }
@ -248,11 +248,11 @@ export default {
// Editable stuff // Editable stuff
avatarImgSrc () { avatarImgSrc () {
const src = this.newAvatar const src = this.newAvatar
return (!src) ? this.defaultAvatar : src return (!src) ? (this.user.profile_image_url_original || this.defaultAvatar) : src
}, },
bannerImgSrc () { bannerImgSrc () {
const src = this.newBanner const src = this.newBanner
return (!src) ? this.defaultBanner : src return (!src) ? (this.user.cover_photo || this.defaultBanner) : src
}, },
defaultAvatar () { defaultAvatar () {
if (this.isDefaultAvatar) { if (this.isDefaultAvatar) {
@ -445,7 +445,7 @@ export default {
// Backend notation. // Backend notation.
display_name: this.newName, display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null), fields_attributes: this.newFields.filter(el => el != null),
show_role: !!this.showRole, show_role: !!this.newShowRole,
birthday: this.newBirthday || '', birthday: this.newBirthday || '',
show_birthday: !!this.showBirthday, show_birthday: !!this.showBirthday,
} }