Skip to content

Commit

Permalink
Fix Problem (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
hahmadia committed Aug 18, 2021
1 parent ee5a047 commit e224b97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webapp/src/store/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {createSlice, PayloadAction, createSelector} from '@reduxjs/toolkit'

import {ContentBlock} from '../blocks/contentBlock'

import {getCards} from './cards'
import {getCards, getTemplates} from './cards'
import {initialLoad, initialReadOnlyLoad} from './initialLoad'

import {RootState} from './index'
Expand Down Expand Up @@ -58,8 +58,9 @@ export function getCardContents(cardId: string): (state: RootState) => Array<Con
return createSelector(
getContentsById,
getCards,
(contents, cards): Array<ContentBlock|ContentBlock[]> => {
const card = cards[cardId]
getTemplates,
(contents, cards, templates): Array<ContentBlock|ContentBlock[]> => {
const card = {...cards, ...templates}[cardId]
const result: Array<ContentBlock|ContentBlock[]> = []
if (card?.fields?.contentOrder) {
for (const contentId of card.fields.contentOrder) {
Expand Down

0 comments on commit e224b97

Please sign in to comment.