From e08313ea0ad612c50dc9c6a9f61342a0f748cff9 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sun, 18 Feb 2018 00:35:49 +0200 Subject: [PATCH] prepend user avatar url by base url if it starts from api base --- web/app/components/comment/comment.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 7e701eb0..e6c9f9bc 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -1,6 +1,7 @@ import { h, Component } from 'preact'; import api from 'common/api'; +import { API_BASE, BASE_URL } from 'common/constants'; import { url } from 'common/settings'; import store from 'common/store'; @@ -155,6 +156,10 @@ export default class Comment extends Component { value: Math.abs(score), sign: score > 0 ? '+' : (score < 0 ? '−' : ''), }, + user: { + ...data.user, + picture: data.user.picture.indexOf(API_BASE) === 0 ? `${BASE_URL}${data.user.picture}` : data.user.picture, + }, }; const defaultMods = {