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 */
|
||||
const filterSectionVisibility = (sections) => {
|
||||
const checkSectionVisibility = (sections) => {
|
||||
const currentUser = getCurrentUser(); // Get current user object
|
||||
const isGuest = isLoggedInAsGuest(); // Check if current user is a guest
|
||||
// const sectionsToReturn = [];
|
||||
// sections.forEach((currentSection) => {
|
||||
// const displayData = currentSection.displayData || {};
|
||||
// if (isSectionVisibleToUser(displayData, currentUser, isGuest)) {
|
||||
// sectionsToReturn.push(currentSection);
|
||||
// }
|
||||
// });
|
||||
|
||||
const filteredSections = sections.filter((currentSection) => {
|
||||
return sections.filter((currentSection) => {
|
||||
const displayData = currentSection.displayData || {};
|
||||
return isSectionVisibleToUser(displayData, currentUser, isGuest);
|
||||
});
|
||||
|
||||
return filteredSections;
|
||||
};
|
||||
|
||||
export default filterSectionVisibility;
|
||||
export default checkSectionVisibility;
|
||||
|
|
|
@ -14,7 +14,6 @@ import {
|
|||
*/
|
||||
export const config = (() => {
|
||||
const Accumulator = new ConfigAccumulator();
|
||||
// return Accumulator.config();
|
||||
return {
|
||||
appConfig: Accumulator.appConfig(),
|
||||
pageInfo: Accumulator.pageInfo(),
|
||||
|
|
Loading…
Reference in New Issue