From 48e16ebce3b018032a682fc1e5d9f1413199b27b Mon Sep 17 00:00:00 2001 From: "l.tingting" Date: Fri, 1 Mar 2024 11:06:34 +0800 Subject: [PATCH] fix: environment variable type conversion issue --- app/config/server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/server.ts b/app/config/server.ts index c455d0b7336..1b64640916f 100644 --- a/app/config/server.ts +++ b/app/config/server.ts @@ -54,7 +54,7 @@ export const getServerSideConfig = () => { ); } - const disableGPT4 = !!process.env.DISABLE_GPT4; + const disableGPT4 = process.env.DISABLE_GPT4 === "1"; let customModels = process.env.CUSTOM_MODELS ?? ""; if (disableGPT4) { @@ -98,10 +98,10 @@ export const getServerSideConfig = () => { proxyUrl: process.env.PROXY_URL, isVercel: !!process.env.VERCEL, - hideUserApiKey: !!process.env.HIDE_USER_API_KEY, + hideUserApiKey: process.env.HIDE_USER_API_KEY === "1", disableGPT4, - hideBalanceQuery: !process.env.ENABLE_BALANCE_QUERY, - disableFastLink: !!process.env.DISABLE_FAST_LINK, + hideBalanceQuery: process.env.ENABLE_BALANCE_QUERY === "0", + disableFastLink: process.env.DISABLE_FAST_LINK === "1", customModels, }; };