Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit f98fa78

Browse files
committed
chore: use better self-hosted check
1 parent 1db1cf2 commit f98fa78

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/pages/apps/[id]/environments/[env-id]/config/EnvironmentConfig.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import Link from "@mui/material/Link";
55
import List from "@mui/material/List";
66
import ListItem from "@mui/material/ListItem";
77
import Typography from "@mui/material/Typography";
8+
import { RootContext } from "~/pages/Root.context";
89
import { AppContext } from "~/pages/apps/[id]/App.context";
910
import { EnvironmentContext } from "~/pages/apps/[id]/environments/Environment.context";
10-
import { isSelfHosted } from "~/utils/helpers/instance";
1111
import TabDomainConfig from "./_components/TabDomainConfig/TabDomainConfig";
1212
import TabConfigEnvVars from "./_components/TabConfigEnvVars";
1313
import TabConfigGeneral from "./_components/TabConfigGeneral";
@@ -21,8 +21,6 @@ import TabAPIKey from "./_components/TabAPIKey";
2121
import TabMailer from "./_components/TabMailer";
2222
import TabAuthWall from "./_components/TabAuthWall";
2323

24-
const selfHosted = isSelfHosted();
25-
2624
interface NavItem {
2725
path: string;
2826
text: string;
@@ -34,13 +32,16 @@ interface NavItemParent {
3432
children: NavItem[];
3533
}
3634

37-
const generateListItems = (app: App): NavItemParent[] => [
35+
const generateListItems = (
36+
app: App,
37+
edition?: "self-hosted" | "cloud" | "development"
38+
): NavItemParent[] => [
3839
{
3940
title: "Deployment settings",
4041
children: [
4142
{ path: "#general", text: "General" },
4243
{ path: "#build", text: "Build", visible: !app.isBare },
43-
{ path: "#server", text: "Server", visible: selfHosted },
44+
{ path: "#server", text: "Server", visible: edition === "self-hosted" },
4445
{ path: "#env-vars", text: "Environment variables" },
4546
{ path: "#status-checks", text: "Status checks", visible: !app.isBare },
4647
].filter(i => i.visible !== false),
@@ -71,12 +72,13 @@ interface TabProps {
7172
}
7273

7374
export default function EnvironmentConfig() {
75+
const { details } = useContext(RootContext);
7476
const [selectedItem, setSelectedItem] = useState<string>("");
7577
const { app, setRefreshToken } = useContext(AppContext);
7678
const { environment } = useContext(EnvironmentContext);
7779
const { hash } = useLocation();
7880
const listItems = useMemo(() => {
79-
return generateListItems(app);
81+
return generateListItems(app, details?.stormkit?.edition);
8082
}, [app]);
8183
const navigate = useNavigate();
8284

@@ -118,7 +120,7 @@ export default function EnvironmentConfig() {
118120
setRefreshToken={setRefreshToken}
119121
/>
120122
)}
121-
{selfHosted && (
123+
{details?.stormkit?.edition === "self-hosted" && (
122124
<TabConfigServer
123125
app={app}
124126
environment={environment}

0 commit comments

Comments
 (0)