From 39fcd716d2c4c48dd27d56ad1bed35b6713242f0 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Ortiz karliatto Date: Mon, 2 Dec 2024 12:53:58 +0100 Subject: [PATCH] feat(suite): external-tor experimental feature --- .../suite/src/constants/suite/experimental.ts | 19 ++++++++++++++++++- packages/suite/src/support/messages.ts | 9 +++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/suite/src/constants/suite/experimental.ts b/packages/suite/src/constants/suite/experimental.ts index cc01bdd5eb57..6e1dcfe00ef8 100644 --- a/packages/suite/src/constants/suite/experimental.ts +++ b/packages/suite/src/constants/suite/experimental.ts @@ -5,7 +5,7 @@ import { Route } from '@suite-common/suite-types'; import { Dispatch } from '../../types/suite'; -export type ExperimentalFeature = 'password-manager' | 'tor-snowflake'; +export type ExperimentalFeature = 'password-manager' | 'tor-snowflake' | 'tor-external'; export type ExperimentalFeatureConfig = { title: TranslationKey; @@ -39,4 +39,21 @@ export const EXPERIMENTAL_FEATURES: Record { + const result = await desktopApi.getTorSettings(); + if (result.success && result.payload.useExternalTor !== newValue) { + await desktopApi.changeTorSettings({ + ...result.payload, + useExternalTor: newValue, + }); + } + if (!newValue) { + } + }, + }, }; diff --git a/packages/suite/src/support/messages.ts b/packages/suite/src/support/messages.ts index 5c9d9b944e73..23f0f31b6a72 100644 --- a/packages/suite/src/support/messages.ts +++ b/packages/suite/src/support/messages.ts @@ -5013,6 +5013,15 @@ const messages = defineMessagesWithTypeCheck({ defaultMessage: 'Access censored websites and apps using Tor Snowflake, a system designed to bypass restrictions.', }, + TR_EXPERIMENTAL_TOR_EXTERNAL: { + id: 'TR_EXPERIMENTAL_TOR_EXTERNAL', + defaultMessage: 'Tor external', + }, + TR_EXPERIMENTAL_TOR_EXTERNAL_DESCRIPTION: { + id: 'TR_EXPERIMENTAL_TOR_EXTERNAL_DESCRIPTION', + defaultMessage: + 'Allow you to use Tor daemon running in a external process instead of the one bundled with Trezor Suite.', + }, TR_EARLY_ACCESS: { id: 'TR_EARLY_ACCESS', defaultMessage: 'Early Access Program',