mirror of https://github.com/Lissy93/dashy.git
💚 Fix code quality issues
This commit is contained in:
parent
426f6a79c3
commit
007a13d868
|
@ -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;
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue