Skip to content

Commit cdb36a8

Browse files
committed
Don't show scratch template
1 parent 4c60dcc commit cdb36a8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

site/src/pages/StarterTemplatesPage/StarterTemplatesPage.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import { useOrganizationId } from "contexts/auth/useOrganizationId";
66
import { pageTitle } from "utils/page";
77
import { getTemplatesByTag } from "utils/starterTemplates";
88
import { StarterTemplatesPageView } from "./StarterTemplatesPageView";
9+
import { TemplateExample } from "api/typesGenerated";
910

1011
const StarterTemplatesPage: FC = () => {
1112
const organizationId = useOrganizationId();
1213
const templateExamplesQuery = useQuery(templateExamples(organizationId));
1314
const starterTemplatesByTag = templateExamplesQuery.data
14-
? getTemplatesByTag(templateExamplesQuery.data)
15+
? // Currently, the scratch template should not be displayed on the starter templates page.
16+
getTemplatesByTag(removeScratchExample(templateExamplesQuery.data))
1517
: undefined;
1618

1719
return (
@@ -28,4 +30,8 @@ const StarterTemplatesPage: FC = () => {
2830
);
2931
};
3032

33+
const removeScratchExample = (data: TemplateExample[]) => {
34+
return data.filter((example) => example.id !== "scratch");
35+
};
36+
3137
export default StarterTemplatesPage;

0 commit comments

Comments
 (0)