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