fix nested information not loading

This commit is contained in:
Nitwel
2020-10-22 18:13:44 +02:00
parent 099d6eb8f3
commit a9c3443935

View File

@@ -30,7 +30,7 @@ export default function usePreview(
return fields.reduce((acc: string[], field) => {
const sections = field.split('.');
if (junctionField === sections[0] && sections.length === 2) acc.push(sections[1]);
if (junctionField === sections[0] && sections.length >= 2) acc.push(sections.slice(1).join('.'));
return acc;
}, []);
}