on master help sign in
pages/applications: remove related grants if none available

Fixes #1895

commit38bfc32f0759e16e45bf1697e9e1e8a582e449fd authorMatilde Park <matilde.park@urbit.org> dateWed 16 Nov 2022, 12:46 (4 years ago) parentbd18606
1 file changed+2−2
pages/applications/[[...application]].js+2−2
pages/applications/[[...application]].js+2−2
@@ -111,7 +111,7 @@ const ApplicationPage = ({ data, markdown, organisation, matchedGrants, search,
111111 markdown={markdown}
112112 />
113113 <hr className="text-wall-200" />
114− {matchedGrants && <div className="basis-full flex flex-col space-y-2">
114+ {matchedGrants.length > 0 && <div className="basis-full flex flex-col space-y-2">
115115 <p className="font-semibold text-wall-400">Related Grants</p>
116116 {matchedGrants.map((grant) => {
117117 return <GrantPreview grant={grant} />
@@ -181,7 +181,7 @@ export const getServerSideProps = async ({ params, res }) => {
181181 ? JSON.stringify(Markdown.parse({ post: { content } }))
182182 : null;
183183
184− const matchedGrants = getGrantsByShortcode(params.application) || null;
184+ const matchedGrants = getGrantsByShortcode(params.application);
185185
186186 if (!data.title) {
187187 data = {