~cytrogen/masto-fe

ref: b2d67fbe339d4852c97cd332a92a2c32b8835cdb masto-fe/app/javascript/flavours/glitch/reducers/media_attachments.js -rw-r--r-- 388 bytes
b2d67fbe — Renaud Chaput [Glitch] Improve modals reducer types 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Map as ImmutableMap } from 'immutable';

import { STORE_HYDRATE } from 'flavours/glitch/actions/store';

const initialState = ImmutableMap({
  accept_content_types: [],
});

export default function meta(state = initialState, action) {
  switch(action.type) {
  case STORE_HYDRATE:
    return state.merge(action.state.get('media_attachments'));
  default:
    return state;
  }
}