mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #6693 from Ocelot-Social-Community/6675-fix-duoble-api-in-avatar-url
fix(webapp): fix proxyapiurl in chat rooms for the avatars
This commit is contained in:
commit
481c78c6c4
@ -334,9 +334,7 @@ export default {
|
||||
;[...this.messages, ...Message].forEach((m) => {
|
||||
if (m.senderId !== this.currentUser.id) m.seen = true
|
||||
m.date = new Date(m.date).toDateString()
|
||||
if (!m.avatar?.startsWith('/api/')) {
|
||||
m.avatar = this.$filters.proxyApiUrl(m.avatar)
|
||||
}
|
||||
m.avatar = this.$filters.proxyApiUrl(m.avatar)
|
||||
msgs[m.indexId] = m
|
||||
})
|
||||
this.messages = msgs.filter(Boolean)
|
||||
|
||||
@ -98,6 +98,7 @@ export default ({ app = {} }) => {
|
||||
proxyApiUrl: (input) => {
|
||||
const url = input && (input.url || input)
|
||||
if (!url) return url
|
||||
if (url.startsWith('/api/')) return url
|
||||
return url.startsWith('/') ? url.replace('/', '/api/') : url
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user