|
1 | 1 | import { useTranslation } from "react-i18next"; |
2 | 2 | import Shortcuts from "./components/Shortcuts"; |
3 | 3 | import SettingsItem from "../SettingsItem"; |
4 | | -import { AppWindowMac, MessageSquareMore, Search, Unplug } from "lucide-react"; |
| 4 | +import { |
| 5 | + AppWindowMac, |
| 6 | + MessageSquareMore, |
| 7 | + Search, |
| 8 | + ShieldCheck, |
| 9 | + Unplug, |
| 10 | +} from "lucide-react"; |
5 | 11 | import { useStartupStore } from "@/stores/startupStore"; |
6 | 12 | import { useEffect } from "react"; |
7 | 13 | import { useConnectStore } from "@/stores/connectStore"; |
8 | 14 | import Appearance from "./components/Appearance"; |
9 | 15 | import SettingsInput from "../SettingsInput"; |
10 | 16 | import platformAdapter from "@/utils/platformAdapter"; |
11 | 17 | import UpdateSettings from "./components/UpdateSettings"; |
| 18 | +import SettingsToggle from "../SettingsToggle"; |
12 | 19 |
|
13 | 20 | const Advanced = () => { |
14 | 21 | const { t } = useTranslation(); |
@@ -42,6 +49,12 @@ const Advanced = () => { |
42 | 49 | const setQueryTimeout = useConnectStore((state) => { |
43 | 50 | return state.setQuerySourceTimeout; |
44 | 51 | }); |
| 52 | + const allowSelfSignature = useConnectStore((state) => { |
| 53 | + return state.allowSelfSignature; |
| 54 | + }); |
| 55 | + const setAllowSelfSignature = useConnectStore((state) => { |
| 56 | + return state.setAllowSelfSignature; |
| 57 | + }); |
45 | 58 |
|
46 | 59 | useEffect(() => { |
47 | 60 | const unsubscribeStartup = useStartupStore.subscribe((state) => { |
@@ -192,6 +205,22 @@ const Advanced = () => { |
192 | 205 | }} |
193 | 206 | /> |
194 | 207 | </SettingsItem> |
| 208 | + |
| 209 | + <SettingsItem |
| 210 | + icon={ShieldCheck} |
| 211 | + title={t("settings.advanced.connect.allowSelfSignature.title")} |
| 212 | + description={t( |
| 213 | + "settings.advanced.connect.allowSelfSignature.description" |
| 214 | + )} |
| 215 | + > |
| 216 | + <SettingsToggle |
| 217 | + label={t("settings.advanced.connect.allowSelfSignature.title")} |
| 218 | + checked={allowSelfSignature} |
| 219 | + onChange={(value) => { |
| 220 | + setAllowSelfSignature(value); |
| 221 | + }} |
| 222 | + /> |
| 223 | + </SettingsItem> |
195 | 224 | </div> |
196 | 225 |
|
197 | 226 | <Appearance /> |
|
0 commit comments