Fix Problem (#1019)

This commit is contained in:
Hossein 2021-08-17 16:36:10 -04:00 committed by GitHub
parent 0675c7e502
commit 7bc168ad84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'
@ -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) {