From 0e93af912e172f055cff7e00092487900fb91d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20L=C3=B3pez?= Date: Wed, 6 Apr 2022 11:51:31 -0600 Subject: [PATCH] Don't display uninstalled apps (#2405) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/app-store/_appRegistry.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/app-store/_appRegistry.ts b/packages/app-store/_appRegistry.ts index 813ba466..97863158 100644 --- a/packages/app-store/_appRegistry.ts +++ b/packages/app-store/_appRegistry.ts @@ -4,9 +4,12 @@ import appStore from "."; /** Mainly to use in listings for the frontend, use in getStaticProps or getServerSideProps */ export function getAppRegistry() { - return Object.values(appStore).map((app) => { + return Object.values(appStore).reduce((apps, app) => { + // Skip if app isn't installed + if (!app.metadata.installed) return apps; // Let's not leak api keys to the front end const { key, ...metadata } = app.metadata; - return metadata; - }) as App[]; + apps.push(metadata); + return apps; + }, [] as Omit[]); }