about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-10-29 14:44:04 +0100
committerThibG <thib@sitedethib.com>2018-10-30 17:51:06 +0100
commitac9780b8449527a6a7ab5e2031eeb37f7f2291e7 (patch)
treece5dac4c0a802688f0c3f8f208ce310b1617f9f9 /app/javascript/flavours/glitch/reducers
parent7f24242ef6d3e6b64f9116dedc3ad60048b4c1bc (diff)
[Glitch] Include preview cards in status entity in REST API
Port 795f0107d23c1c9bd039f6449fa1e094ab7653a7 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/index.js2
-rw-r--r--app/javascript/flavours/glitch/reducers/statuses.js5
2 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/reducers/index.js b/app/javascript/flavours/glitch/reducers/index.js
index 218a5ac8f..ae9e2b639 100644
--- a/app/javascript/flavours/glitch/reducers/index.js
+++ b/app/javascript/flavours/glitch/reducers/index.js
@@ -15,7 +15,6 @@ import settings from './settings';
 import local_settings from './local_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';
@@ -47,7 +46,6 @@ const reducers = {
   settings,
   local_settings,
   push_notifications,
-  cards,
   mutes,
   reports,
   contexts,
diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js
index 617d96e5d..4c6387461 100644
--- a/app/javascript/flavours/glitch/reducers/statuses.js
+++ b/app/javascript/flavours/glitch/reducers/statuses.js
@@ -24,6 +24,9 @@ import {
   STATUS_UNMUTE_SUCCESS,
 } from 'flavours/glitch/actions/statuses';
 import {
+  STATUS_CARD_FETCH_SUCCESS
+} from 'flavours/glitch/actions/cards';
+import {
   TIMELINE_UPDATE,
   TIMELINE_DELETE,
   TIMELINE_EXPAND_SUCCESS,
@@ -143,6 +146,8 @@ export default function statuses(state = initialState, action) {
     return normalizeStatuses(state, action.statuses);
   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;
   }