From c768d97637712914e7302ac567c72f09c63e5916 Mon Sep 17 00:00:00 2001 From: Ethan <118581835+realethanhsu@users.noreply.github.com> Date: Mon, 21 Apr 2025 10:04:33 +0800 Subject: [PATCH] feat: update privacy policy URL and add validation for privacy policy link (#18422) --- web/app/components/app/overview/settings/index.tsx | 13 ++++++++++++- web/i18n/de-DE/app-overview.ts | 1 + web/i18n/en-US/app-overview.ts | 1 + web/i18n/es-ES/app-overview.ts | 1 + web/i18n/fa-IR/app-overview.ts | 1 + web/i18n/fr-FR/app-overview.ts | 1 + web/i18n/hi-IN/app-overview.ts | 1 + web/i18n/it-IT/app-overview.ts | 1 + web/i18n/ja-JP/app-overview.ts | 1 + web/i18n/ko-KR/app-overview.ts | 1 + web/i18n/pl-PL/app-overview.ts | 1 + web/i18n/pt-BR/app-overview.ts | 1 + web/i18n/ro-RO/app-overview.ts | 1 + web/i18n/ru-RU/app-overview.ts | 1 + web/i18n/sl-SI/app-overview.ts | 1 + web/i18n/th-TH/app-overview.ts | 1 + web/i18n/tr-TR/app-overview.ts | 1 + web/i18n/uk-UA/app-overview.ts | 1 + web/i18n/vi-VN/app-overview.ts | 1 + web/i18n/zh-Hans/app-overview.ts | 1 + web/i18n/zh-Hant/app-overview.ts | 1 + 21 files changed, 32 insertions(+), 1 deletion(-) 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: }} />