Don't display uninstalled apps (#2405)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/2406/head
parent
d1ffd1edae
commit
0e93af912e
|
@ -4,9 +4,12 @@ import appStore from ".";
|
||||||
|
|
||||||
/** Mainly to use in listings for the frontend, use in getStaticProps or getServerSideProps */
|
/** Mainly to use in listings for the frontend, use in getStaticProps or getServerSideProps */
|
||||||
export function getAppRegistry() {
|
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
|
// Let's not leak api keys to the front end
|
||||||
const { key, ...metadata } = app.metadata;
|
const { key, ...metadata } = app.metadata;
|
||||||
return metadata;
|
apps.push(metadata);
|
||||||
}) as App[];
|
return apps;
|
||||||
|
}, [] as Omit<App, "key">[]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue