mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Show enabled alpha apps in sidebar and app store (#1449)
This commit is contained in:
parent
512099ed23
commit
2c620aa208
@ -46,9 +46,9 @@ export default function PageClient() {
|
||||
const filteredApps = useMemo(() => {
|
||||
let apps = Object.keys(ALL_APPS) as AppId[];
|
||||
|
||||
// Filter out alpha apps in production
|
||||
// Filter out alpha apps in production, but keep enabled ones
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
apps = apps.filter(appId => ALL_APPS[appId].stage !== "alpha");
|
||||
apps = apps.filter(appId => ALL_APPS[appId].stage !== "alpha" || installedAppsSet.has(appId));
|
||||
}
|
||||
|
||||
// Apply category filter
|
||||
@ -88,14 +88,14 @@ export default function PageClient() {
|
||||
const getCategoryCount = (categoryId: string) => {
|
||||
if (categoryId === "installed") return installedApps.length;
|
||||
if (categoryId === "all") return Object.keys(ALL_APPS).filter(appId =>
|
||||
process.env.NODE_ENV === "development" || ALL_APPS[appId as AppId].stage !== "alpha"
|
||||
process.env.NODE_ENV === "development" || ALL_APPS[appId as AppId].stage !== "alpha" || installedAppsSet.has(appId as AppId)
|
||||
).length;
|
||||
|
||||
const category = CATEGORIES.find(c => c.id === categoryId);
|
||||
if (!category) return 0;
|
||||
|
||||
return (Object.entries(ALL_APPS) as [AppId, typeof ALL_APPS[AppId]][]).filter(([appId, app]) => {
|
||||
if (process.env.NODE_ENV !== "development" && app.stage === "alpha") return false;
|
||||
if (process.env.NODE_ENV !== "development" && app.stage === "alpha" && !installedAppsSet.has(appId)) return false;
|
||||
return app.tags.some((tag: string) => category.tags.includes(tag));
|
||||
}).length;
|
||||
};
|
||||
|
||||
@ -38,9 +38,13 @@ export function isAppEnabled(installedApps: InstalledAppsMap, appId: AppId): boo
|
||||
|
||||
/**
|
||||
* Get all enabled app IDs using centralized enabled/sub-app logic.
|
||||
*
|
||||
* Unlike `getAllAvailableAppIds`, this intentionally includes alpha-stage apps
|
||||
* that are explicitly enabled. The alpha filter only gates *discovery*
|
||||
* (app store listing, onboarding wizard), not functionality.
|
||||
*/
|
||||
export function getEnabledAppIds(installedApps: InstalledAppsMap): AppId[] {
|
||||
return getAllAvailableAppIds().filter((appId) => isAppEnabled(installedApps, appId));
|
||||
return (Object.keys(ALL_APPS) as AppId[]).filter((appId) => isAppEnabled(installedApps, appId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user