diff options
author | Sorin Davidoi <sorin.davidoi@gmail.com> | 2017-08-07 20:32:03 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-08-07 20:32:03 +0200 |
commit | 8eb6d171e690e013eb2881478cfa1fd50b4ba705 (patch) | |
tree | c0b2305a4bbe66298771699c42d6ce74c2373365 /app/javascript/mastodon/reducers/accounts.js | |
parent | 594234740788a51fa528152343eb50dc1c6ca093 (diff) |
feat: Cache status height to avoid expensive renders (#4439)
* feat: Cache status height to avoid expensive renders * feat: Escape content and emojify in reducers * fix(css): Remove backface-visibility: hidden from .scrollable * fix(statuses): Avoid creating DOMParses inside a loop
Diffstat (limited to 'app/javascript/mastodon/reducers/accounts.js')
-rw-r--r-- | app/javascript/mastodon/reducers/accounts.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/accounts.js b/app/javascript/mastodon/reducers/accounts.js index 4d7c3adc9..6442d13be 100644 --- a/app/javascript/mastodon/reducers/accounts.js +++ b/app/javascript/mastodon/reducers/accounts.js @@ -44,7 +44,9 @@ import { FAVOURITED_STATUSES_EXPAND_SUCCESS, } from '../actions/favourites'; import { STORE_HYDRATE } from '../actions/store'; +import emojify from '../emoji'; import { Map as ImmutableMap, fromJS } from 'immutable'; +import escapeTextContentForBrowser from 'escape-html'; const normalizeAccount = (state, account) => { account = { ...account }; @@ -53,6 +55,10 @@ const normalizeAccount = (state, account) => { delete account.following_count; delete account.statuses_count; + const displayName = account.display_name.length === 0 ? account.username : account.display_name; + account.display_name_html = emojify(escapeTextContentForBrowser(displayName)); + account.note_emojified = emojify(account.note); + return state.set(account.id, fromJS(account)); }; |