From 5f0e2fc0c3386f986d1ae938dfd7541379ef722d Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Wed, 3 Sep 2025 07:15:04 +0800 Subject: [PATCH] fix: data privacy setting --- src/components/ChatBox/index.tsx | 34 ++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/ChatBox/index.tsx b/src/components/ChatBox/index.tsx index 721eeb452..9abb7b906 100644 --- a/src/components/ChatBox/index.tsx +++ b/src/components/ChatBox/index.tsx @@ -514,13 +514,6 @@ export default function ChatBox(): JSX.Element { ) : (
{ - if (!privacy) { - // navigate("/setting/privacy"); - // setPrivacyDialogOpen(true); - } - }} - style={{ cursor: !privacy ? "pointer" : "default" }} >
@@ -554,9 +547,28 @@ export default function ChatBox(): JSX.Element {
{ - e.stopPropagation(); - // setPrivacyDialogOpen(true); - navigate("/setting/privacy"); + // Check if the click target is an anchor tag + const target = e.target as HTMLElement; + if (target.tagName === 'A') { + // Let the anchor tag handle the click naturally + return; + } + + // Enable privacy permissions + const API_FIELDS = [ + "take_screenshot", + "access_local_software", + "access_your_address", + "password_storage", + ]; + const requestData = { + [API_FIELDS[0]]: true, + [API_FIELDS[1]]: true, + [API_FIELDS[2]]: true, + [API_FIELDS[3]]: true, + }; + proxyFetchPut("/api/user/privacy", requestData); + setPrivacy(true); }} className=" cursor-pointer flex items-center gap-1 px-sm py-xs rounded-md bg-surface-information" > @@ -570,6 +582,7 @@ export default function ChatBox(): JSX.Element { href="https://www.eigent.ai/terms-of-use" target="_blank" className="text-text-information underline" + onClick={(e) => e.stopPropagation()} > Terms of Use {" "} @@ -578,6 +591,7 @@ export default function ChatBox(): JSX.Element { href="https://www.eigent.ai/privacy-policy" target="_blank" className="text-text-information underline" + onClick={(e) => e.stopPropagation()} > Privacy Policy