diff --git a/apps/new/widget/page/projects/Involved.jsx b/apps/new/widget/page/projects/Involved.jsx index 4c23d1fb..c03cfb98 100644 --- a/apps/new/widget/page/projects/Involved.jsx +++ b/apps/new/widget/page/projects/Involved.jsx @@ -13,14 +13,10 @@ if (!context.accountId) { const { fetchProjects } = VM.require( "${config_account}/widget/lib.projects", ) || { - fetchProjects: () => {}, + fetchProjects: () => [], }; -if (!fetchProjects) { - return ""; -} - -const projects = fetchProjects() || []; +const projects = fetchProjects(); projects = projects.filter((project) => project.contributors.includes(context.accountId), diff --git a/apps/new/widget/page/projects/List.jsx b/apps/new/widget/page/projects/List.jsx index 1828d16d..a4466df0 100644 --- a/apps/new/widget/page/projects/List.jsx +++ b/apps/new/widget/page/projects/List.jsx @@ -5,18 +5,10 @@ const { Button } = VM.require("${alias_old}/widget/components") || { const { fetchProjects } = VM.require( "${config_account}/widget/lib.projects", ) || { - fetchProjects: () => {}, + fetchProjects: () => [], }; -if (!fetchProjects) { - return ""; -} - -const projects = fetchProjects() || []; - -if (!projects) { - return ""; -} +const projects = fetchProjects(); return ( )} - {showOpenRoles && } + {/* + Commenting out until roles feature is included + {showOpenRoles && } + */}

{description}

diff --git a/apps/new/widget/page/projects/MyProjects.jsx b/apps/new/widget/page/projects/MyProjects.jsx index c071203d..b5f7396c 100644 --- a/apps/new/widget/page/projects/MyProjects.jsx +++ b/apps/new/widget/page/projects/MyProjects.jsx @@ -13,22 +13,14 @@ if (!context.accountId) { const { fetchProjects } = VM.require( "${config_account}/widget/lib.projects", ) || { - fetchProjects: () => {}, + fetchProjects: () => [], }; -if (!fetchProjects) { - return ""; -} - -const projects = fetchProjects() || []; +const projects = fetchProjects(); projects = projects.filter( (project) => project.accountId === context.accountId, ); -if (!projects) { - return ""; -} - return ( {}, + fetchProjects: () => [], }; -if (!fetchProjects) { - return ""; -} const stars = Social.getr( `${context.accountId}/graph/star/*/project`, "final", @@ -64,14 +61,9 @@ const starredProjectIds = starredProjects.map( (project) => project.split("/")[2], ); -const projects = - fetchProjects().filter((project) => - starredProjectIds.includes(project.projectID), - ) || []; - -if (!projects) { - return ""; -} +const projects = fetchProjects().filter((project) => + starredProjectIds.includes(project.projectID), +); return (