@@ -66,7 +66,7 @@ import { getNetwork } from "store/config";
6666import { currencySymbol } from "utils/formatUtils" ;
6767import InfoBox from "renderer/components/pages/swap/swap/components/InfoBox" ;
6868import { isValidMultiAddressWithPeerId } from "utils/parseUtils" ;
69- import { getNodeStatus } from "renderer/rpc" ;
69+ import { getNodeStatus , getTorForcedExcuse } from "renderer/rpc" ;
7070import { setStatus } from "store/features/nodesSlice" ;
7171import MoneroAddressTextField from "renderer/components/inputs/MoneroAddressTextField" ;
7272import BitcoinAddressTextField from "renderer/components/inputs/BitcoinAddressTextField" ;
@@ -704,24 +704,32 @@ function NodeTable({
704704 ) ;
705705}
706706
707+ const torForced = await getTorForcedExcuse ( ) ;
707708export function TorSettings ( ) {
708709 const dispatch = useAppDispatch ( ) ;
709710 const torEnabled = useSettings ( ( settings ) => settings . enableTor ) ;
710711 const handleChange = ( event : React . ChangeEvent < HTMLInputElement > ) =>
711712 dispatch ( setTorEnabled ( event . target . checked ) ) ;
712- const status = ( state : boolean ) => ( state === true ? "enabled" : "disabled" ) ;
713713
714714 return (
715715 < TableRow >
716716 < TableCell >
717717 < SettingLabel
718718 label = "Use Tor"
719- tooltip = "Route network traffic through Tor to hide your IP address from the maker."
719+ tooltip = {
720+ "Route network traffic through Tor to hide your IP address from the maker. " +
721+ torForced
722+ }
720723 />
721724 </ TableCell >
722725
723726 < TableCell >
724- < Switch checked = { torEnabled } onChange = { handleChange } color = "primary" />
727+ < Switch
728+ disabled = { torForced }
729+ checked = { torEnabled || torForced }
730+ onChange = { handleChange }
731+ color = "primary"
732+ />
725733 </ TableCell >
726734 </ TableRow >
727735 ) ;
@@ -740,7 +748,8 @@ function MoneroTorSettings() {
740748 dispatch ( setEnableMoneroTor ( event . target . checked ) ) ;
741749
742750 // Hide this setting if Tor is disabled entirely
743- if ( ! torEnabled ) {
751+ // Hide this setting if it's superseded by the global Tor connection
752+ if ( ! torEnabled || torForced ) {
744753 return null ;
745754 }
746755
0 commit comments