fixes for missing/incorrect avatar fallbacks

This commit is contained in:
Henry Jameson 2026-05-07 16:25:32 +03:00
commit 3d84c6eea1
3 changed files with 6 additions and 6 deletions

View file

@ -175,14 +175,14 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
if (source === 'name') return if (source === 'name') return
if (INSTANCE_IDENTIY_EXTERNAL.has(source)) return if (INSTANCE_IDENTIY_EXTERNAL.has(source)) return
useInstanceStore().set({ useInstanceStore().set({
value: config[source], value: config[source] ?? INSTANCE_IDENTITY_DEFAULT_DEFINITIONS[source].default,
path: `instanceIdentity.${source}`, path: `instanceIdentity.${source}`,
}) })
}) })
Object.keys(INSTANCE_DEFAULT_CONFIG_DEFINITIONS).forEach((source) => Object.keys(INSTANCE_DEFAULT_CONFIG_DEFINITIONS).forEach((source) =>
useInstanceStore().set({ useInstanceStore().set({
value: config[source], value: config[source] ?? INSTANCE_DEFAULT_CONFIG_DEFINITIONS[source].default,
path: `prefsStorage.${source}`, path: `prefsStorage.${source}`,
}), }),
) )

View file

@ -362,7 +362,7 @@ export default {
) )
}, },
isDefaultAvatar() { isDefaultAvatar() {
const baseAvatar = useInstanceStore().defaultAvatar const baseAvatar = useInstanceStore().instanceIdenitity.defaultAvatar
return ( return (
!this.$store.state.users.currentUser.profile_image_url || !this.$store.state.users.currentUser.profile_image_url ||
this.$store.state.users.currentUser.profile_image_url.includes( this.$store.state.users.currentUser.profile_image_url.includes(
@ -371,7 +371,7 @@ export default {
) )
}, },
isDefaultBanner() { isDefaultBanner() {
const baseBanner = useInstanceStore().defaultBanner const baseBanner = useInstanceStore().instanceIdentity.defaultBanner
return ( return (
!this.$store.state.users.currentUser.cover_photo || !this.$store.state.users.currentUser.cover_photo ||
this.$store.state.users.currentUser.cover_photo.includes(baseBanner) this.$store.state.users.currentUser.cover_photo.includes(baseBanner)

View file

@ -12,7 +12,7 @@ function showWhoToFollow(panel, reply) {
panel.usersToFollow.forEach((toFollow, index) => { panel.usersToFollow.forEach((toFollow, index) => {
const user = shuffled[index] const user = shuffled[index]
const img = user.avatar || useInstanceStore().defaultAvatar const img = user.avatar || useInstanceStore().instanceIdentity.defaultAvatar
const name = user.acct const name = user.acct
toFollow.img = img toFollow.img = img
@ -71,7 +71,7 @@ const WhoToFollowPanel = {
}, },
mounted: function () { mounted: function () {
this.usersToFollow = new Array(3).fill().map(() => ({ this.usersToFollow = new Array(3).fill().map(() => ({
img: useInstanceStore().defaultAvatar, img: useInstanceStore().instanceIdentity.defaultAvatar,
name: '', name: '',
id: 0, id: 0,
})) }))