💚 Fix code quality issues

This commit is contained in:
Alicia Sykes 2021-08-21 17:24:11 +01:00
parent 426f6a79c3
commit 007a13d868
2 changed files with 3 additions and 14 deletions

View File

@ -42,23 +42,13 @@ const isSectionVisibleToUser = (displayData, currentUser, isGuest) => {
}; };
/* Putting it all together, the function to export */ /* Putting it all together, the function to export */
const filterSectionVisibility = (sections) => { const checkSectionVisibility = (sections) => {
const currentUser = getCurrentUser(); // Get current user object const currentUser = getCurrentUser(); // Get current user object
const isGuest = isLoggedInAsGuest(); // Check if current user is a guest const isGuest = isLoggedInAsGuest(); // Check if current user is a guest
// const sectionsToReturn = []; return sections.filter((currentSection) => {
// sections.forEach((currentSection) => {
// const displayData = currentSection.displayData || {};
// if (isSectionVisibleToUser(displayData, currentUser, isGuest)) {
// sectionsToReturn.push(currentSection);
// }
// });
const filteredSections = sections.filter((currentSection) => {
const displayData = currentSection.displayData || {}; const displayData = currentSection.displayData || {};
return isSectionVisibleToUser(displayData, currentUser, isGuest); return isSectionVisibleToUser(displayData, currentUser, isGuest);
}); });
return filteredSections;
}; };
export default filterSectionVisibility; export default checkSectionVisibility;

View File

@ -14,7 +14,6 @@ import {
*/ */
export const config = (() => { export const config = (() => {
const Accumulator = new ConfigAccumulator(); const Accumulator = new ConfigAccumulator();
// return Accumulator.config();
return { return {
appConfig: Accumulator.appConfig(), appConfig: Accumulator.appConfig(),
pageInfo: Accumulator.pageInfo(), pageInfo: Accumulator.pageInfo(),