diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-10-07 02:38:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-07 02:38:52 +0200 |
commit | 45682f876d4257c61b1d42469d04dd53fc4f8189 (patch) | |
tree | 38acd9df3c58d3ab0fdd8acd44065bc5b914be40 /app/javascript/mastodon/reducers | |
parent | 4413d81d7f7b290f7e69ce3397ca969ea1c96622 (diff) |
Make auto-play GIFs preference affect custom emojis in web UI (#5254)
Diffstat (limited to 'app/javascript/mastodon/reducers')
-rw-r--r-- | app/javascript/mastodon/reducers/custom_emojis.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/reducers/statuses.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/mastodon/reducers/custom_emojis.js b/app/javascript/mastodon/reducers/custom_emojis.js index 307bcc7dc..f2a8ca5d2 100644 --- a/app/javascript/mastodon/reducers/custom_emojis.js +++ b/app/javascript/mastodon/reducers/custom_emojis.js @@ -8,7 +8,7 @@ const initialState = ImmutableList(); export default function custom_emojis(state = initialState, action) { switch(action.type) { case STORE_HYDRATE: - emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) }); + emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', []), action.state.getIn(['meta', 'auto_play_gif'], false)) }); return action.state.get('custom_emojis'); default: return state; diff --git a/app/javascript/mastodon/reducers/statuses.js b/app/javascript/mastodon/reducers/statuses.js index 32772fff7..b1fb4c5da 100644 --- a/app/javascript/mastodon/reducers/statuses.js +++ b/app/javascript/mastodon/reducers/statuses.js @@ -58,9 +58,10 @@ const normalizeStatus = (state, status) => { normalStatus.reblog = status.reblog.id; } - const searchContent = [status.spoiler_text, status.content].join(' ').replace(/<br \/>/g, '\n').replace(/<\/p><p>/g, '\n\n'); + const searchContent = [status.spoiler_text, status.content].join('\n\n').replace(/<br \/>/g, '\n').replace(/<\/p><p>/g, '\n\n'); + const emojiMap = normalStatus.emojis.reduce((obj, emoji) => { - obj[`:${emoji.shortcode}:`] = emoji.static_url; + obj[`:${emoji.shortcode}:`] = emoji; return obj; }, {}); |