diff options
author | Matt Sweetman <webroo@gmail.com> | 2018-09-24 04:44:01 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-24 05:44:01 +0200 |
commit | 1889526e23ce41a37395fdcf89bd415bb2f7546f (patch) | |
tree | 0f8f33d2f0502041855db7b943a28250a97196be /app/javascript | |
parent | c39183cc628ea9556db53af5059656d6b63609ba (diff) |
Add user preference to always expand toots marked with content warnings (#8762)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/actions/importer/normalizer.js | 3 | ||||
-rw-r--r-- | app/javascript/mastodon/initial_state.js | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js index 10a39e050..a2af3222e 100644 --- a/app/javascript/mastodon/actions/importer/normalizer.js +++ b/app/javascript/mastodon/actions/importer/normalizer.js @@ -1,6 +1,7 @@ import escapeTextContentForBrowser from 'escape-html'; import emojify from '../../features/emoji/emoji'; import { unescapeHTML } from '../../utils/html'; +import { expandSpoilers } from '../../initial_state'; const domParser = new DOMParser(); @@ -57,7 +58,7 @@ export function normalizeStatus(status, normalOldStatus) { normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent; normalStatus.contentHtml = emojify(normalStatus.content, emojiMap); normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap); - normalStatus.hidden = spoilerText.length > 0 || normalStatus.sensitive; + normalStatus.hidden = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive; } return normalStatus; diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index 6ffb4cbfb..e615de09c 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -6,6 +6,7 @@ const getMeta = (prop) => initialState && initialState.meta && initialState.meta export const reduceMotion = getMeta('reduce_motion'); export const autoPlayGif = getMeta('auto_play_gif'); export const displaySensitiveMedia = getMeta('display_sensitive_media'); +export const expandSpoilers = getMeta('expand_spoilers'); export const unfollowModal = getMeta('unfollow_modal'); export const boostModal = getMeta('boost_modal'); export const deleteModal = getMeta('delete_modal'); |