Pull expandSpoilers from Redux store
This commit is contained in:
parent
5fdcd80ceb
commit
f20e5f7899
3 changed files with 7 additions and 4 deletions
|
@ -64,7 +64,10 @@ export function importFetchedStatuses(statuses) {
|
|||
const polls = [];
|
||||
|
||||
function processStatus(status) {
|
||||
pushUnique(normalStatuses, normalizeStatus(status, getState().getIn(['statuses', status.id])));
|
||||
const normalOldStatus = getState().getIn(['statuses', status.id]);
|
||||
const readingPrefs = getState().getIn(['preferences', 'reading']);
|
||||
|
||||
pushUnique(normalStatuses, normalizeStatus(status, normalOldStatus, readingPrefs));
|
||||
pushUnique(accounts, status.account);
|
||||
|
||||
if (status.reblog && status.reblog.id) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
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();
|
||||
|
||||
|
@ -35,8 +34,10 @@ export function normalizeAccount(account) {
|
|||
return account;
|
||||
}
|
||||
|
||||
export function normalizeStatus(status, normalOldStatus) {
|
||||
export function normalizeStatus(status, normalOldStatus, readingPrefs) {
|
||||
const normalStatus = { ...status };
|
||||
const expandSpoilers = readingPrefs.getIn(['expand', 'spoilers']);
|
||||
|
||||
normalStatus.account = status.account.id;
|
||||
|
||||
if (status.reblog && status.reblog.id) {
|
||||
|
|
|
@ -8,7 +8,6 @@ const getMeta = (prop) => initialState && initialState.meta && initialState.meta
|
|||
export const reduceMotion = getMeta('reduce_motion');
|
||||
export const autoPlayGif = getMeta('auto_play_gif');
|
||||
export const displayMedia = getMeta('display_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');
|
||||
|
|
Loading…
Reference in a new issue