From 68f19912d3b0740a1b0ee7bcac64f29930fdbd1c Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Wed, 30 Mar 2022 13:08:52 -0400 Subject: [PATCH] fix: custom forms not loading in form gallery --- .../FormGallery/FormsHorizontalView/index.js | 7 ++++--- domains/DataCollection/FormGallery/index.js | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/domains/DataCollection/FormGallery/FormsHorizontalView/index.js b/domains/DataCollection/FormGallery/FormsHorizontalView/index.js index d3e81aaff..9c9681825 100644 --- a/domains/DataCollection/FormGallery/FormsHorizontalView/index.js +++ b/domains/DataCollection/FormGallery/FormsHorizontalView/index.js @@ -6,6 +6,7 @@ import { import { Card, Text, } from 'react-native-paper'; +import uuid from 'react-native-uuid'; import I18n from '../../../../modules/i18n'; import { layout } from '../../../../modules/theme'; @@ -14,7 +15,7 @@ import styles from '../index.styles'; const FormsHorizontalView = ({ forms, header, navigateToCustomForm, pinForm }) => ( - + uuid.v4()} style={layout.screenRow}> {header && ( {header} @@ -23,7 +24,7 @@ const FormsHorizontalView = ({ {forms.map((form) => ( uuid.v4() || form.objectId} style={layout.cardSmallStyle} onPress={() => { navigateToCustomForm(form); @@ -41,7 +42,7 @@ const FormsHorizontalView = ({ ))} {forms?.length < 1 && ( - + uuid.v4()}> {/* To be used when marketplace is available */} {/* diff --git a/domains/DataCollection/FormGallery/index.js b/domains/DataCollection/FormGallery/index.js index 46431137d..cb738e5d8 100644 --- a/domains/DataCollection/FormGallery/index.js +++ b/domains/DataCollection/FormGallery/index.js @@ -30,10 +30,8 @@ const FormGallery = ({ useEffect(() => { getData('customForms').then((forms) => { - if (forms) { - setCustomForms(forms); - filterWorkflows(forms); - } + setCustomForms(forms || []); + filterWorkflows(forms || []); }); }, [customForms]);