diff --git a/web/README.md b/web/README.md index 3236347e80..3d9fd2de87 100644 --- a/web/README.md +++ b/web/README.md @@ -7,7 +7,7 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next ### Run by source code Before starting the web frontend service, please make sure the following environment is ready. -- [Node.js](https://nodejs.org) >= v18.x +- [Node.js](https://nodejs.org) >= v22.11.x - [pnpm](https://pnpm.io) v10.x First, install the dependencies: diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index 896229d433..679d616e54 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -162,11 +162,22 @@ const SettingsModal: FC = ({ return check } + const validatePrivacyPolicy = (privacyPolicy: string | null) => { + if (privacyPolicy === null || privacyPolicy?.length === 0) + return true + + return privacyPolicy.startsWith('http://') || privacyPolicy.startsWith('https://') + } + if (inputInfo !== null) { if (!validateColorHex(inputInfo.chatColorTheme)) { notify({ type: 'error', message: t(`${prefixSettings}.invalidHexMessage`) }) return } + if (!validatePrivacyPolicy(inputInfo.privacyPolicy)) { + notify({ type: 'error', message: t(`${prefixSettings}.invalidPrivacyPolicy`) }) + return + } } setSaveLoading(true) @@ -410,7 +421,7 @@ const SettingsModal: FC = ({

}} + components={{ privacyPolicyLink: }} />

=18.18.0" + "node": ">=v22.11.0" }, "scripts": { "dev": "cross-env NODE_OPTIONS='--inspect' next dev",