Include preview cards in status entity in REST API (#9120)

* Include preview cards in status entity in REST API

* Display preview card in-stream

* Improve in-stream display of preview cards
This commit is contained in:
Eugen Rochko
2018-10-28 06:35:03 +01:00
committed by GitHub
parent 6f78500d4f
commit 795f0107d2
10 changed files with 61 additions and 11 deletions

View File

@ -14,7 +14,6 @@ import relationships from './relationships';
import settings from './settings';
import push_notifications from './push_notifications';
import status_lists from './status_lists';
import cards from './cards';
import mutes from './mutes';
import reports from './reports';
import contexts from './contexts';
@ -46,7 +45,6 @@ const reducers = {
relationships,
settings,
push_notifications,
cards,
mutes,
reports,
contexts,

View File

@ -10,6 +10,7 @@ import {
STATUS_REVEAL,
STATUS_HIDE,
} from '../actions/statuses';
import { STATUS_CARD_FETCH_SUCCESS } from '../actions/cards';
import { TIMELINE_DELETE } from '../actions/timelines';
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
import { Map as ImmutableMap, fromJS } from 'immutable';
@ -65,6 +66,8 @@ export default function statuses(state = initialState, action) {
});
case TIMELINE_DELETE:
return deleteStatus(state, action.id, action.references);
case STATUS_CARD_FETCH_SUCCESS:
return state.setIn([action.id, 'card'], fromJS(action.card));
default:
return state;
}