Fix Problem (#1019)
This commit is contained in:
parent
0675c7e502
commit
7bc168ad84
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,7 @@ import {createSlice, PayloadAction, createSelector} from '@reduxjs/toolkit'
|
||||||
|
|
||||||
import {ContentBlock} from '../blocks/contentBlock'
|
import {ContentBlock} from '../blocks/contentBlock'
|
||||||
|
|
||||||
import {getCards} from './cards'
|
import {getCards, getTemplates} from './cards'
|
||||||
import {initialLoad, initialReadOnlyLoad} from './initialLoad'
|
import {initialLoad, initialReadOnlyLoad} from './initialLoad'
|
||||||
|
|
||||||
import {RootState} from './index'
|
import {RootState} from './index'
|
||||||
|
@ -58,8 +58,9 @@ export function getCardContents(cardId: string): (state: RootState) => Array<Con
|
||||||
return createSelector(
|
return createSelector(
|
||||||
getContentsById,
|
getContentsById,
|
||||||
getCards,
|
getCards,
|
||||||
(contents, cards): Array<ContentBlock|ContentBlock[]> => {
|
getTemplates,
|
||||||
const card = cards[cardId]
|
(contents, cards, templates): Array<ContentBlock|ContentBlock[]> => {
|
||||||
|
const card = {...cards, ...templates}[cardId]
|
||||||
const result: Array<ContentBlock|ContentBlock[]> = []
|
const result: Array<ContentBlock|ContentBlock[]> = []
|
||||||
if (card?.fields?.contentOrder) {
|
if (card?.fields?.contentOrder) {
|
||||||
for (const contentId of card.fields.contentOrder) {
|
for (const contentId of card.fields.contentOrder) {
|
||||||
|
|
Loading…
Reference in a new issue