Skip to content

Commit

Permalink
Correction de l'erreur en console quand undefined était passé au pars…
Browse files Browse the repository at this point in the history
…er markdown
  • Loading branch information
DavidBruant committed Mar 19, 2017
1 parent 6e0f8d3 commit 580b761
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/public/js/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function reducer(state, action) {
case ATEMPORAL_TEXTS_RECEIVED: {
let textMap = state.get('textsById');

action.textList.forEach(({id, text}) => {
action.textList.forEach(({id, text = ''}) => {
const financeElementTexts = textMap
.get(id, new FinanceElementTextsRecord())
.set('atemporal', md.render(text));
Expand All @@ -48,7 +48,7 @@ export default function reducer(state, action) {
const year = action.year;
let textMap = state.get('textsById');

action.textList.forEach(({id, text}) => {
action.textList.forEach(({id, text = ''}) => {
let financeElementTexts = textMap.get(id, new FinanceElementTextsRecord());
let byYear = financeElementTexts.get(year, new ImmutableMap()).set(year, md.render(text));

Expand All @@ -60,7 +60,7 @@ export default function reducer(state, action) {
case LABELS_RECEIVED: {
let textMap = state.get('textsById');

action.labelList.forEach(({id, text}) => {
action.labelList.forEach(({id, text = ''}) => {
const financeElementTexts = textMap
.get(id, new FinanceElementTextsRecord())
.set('label', text);
Expand Down
15 changes: 0 additions & 15 deletions src/public/js/stateToProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,7 @@ import hierarchicalAggregated from '../../shared/js/finance/hierarchicalAggregat
import {flattenTree} from '../../shared/js/finance/visitHierarchical.js';
import navigationTree from './navigationTree';

/*
interface FinanceElementProps{
contentId: string,
total: number, // total amount of money for this element
texts: FinanceElementTextsRecord,
// the partition will be displayed in the order it's passed. Sort beforehand if necessary
partition: Array<{
contentId: string,
amount: number,
texts: FinanceElementTextsRecord
}>
}

*/
function makePartition(contentId, totalById, textsById){
const childrenIds = navigationTree[contentId];

Expand Down

0 comments on commit 580b761

Please sign in to comment.