Skip to content

Commit

Permalink
Merge pull request #3011 from bithyve/dev
Browse files Browse the repository at this point in the history
build 205
  • Loading branch information
cakesoft-shashank authored Jul 14, 2023
2 parents 0bfee15 + fc47372 commit 7d5f16b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 34 deletions.
32 changes: 20 additions & 12 deletions src/screens/AppSettings/TorModalMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ function TorConnectionFailed() {
</Box>
<Box marginTop={hp(40)}>
<Text color="light.greenText" fontSize={13} padding={1} letterSpacing={0.65}>
There was an error when connecting via Tor
Could not established connection with Whirlpool client over in-app Tor. Try again later or
use other options
</Text>
</Box>
</Box>
Expand All @@ -79,18 +80,24 @@ function TorEnabledContent() {
}

function TorModalMap({ visible, close, onPressTryAgain }) {
const [torStatus, settorStatus] = useState<TorStatus>(RestClient.getTorStatus());
const [torStatus, settorStatus] = useState<TorStatus>(TorStatus.CONNECTING);

const onChangeTorStatus = (status: TorStatus) => {
settorStatus(status);
};

useEffect(() => {
RestClient.subToTorStatus(onChangeTorStatus);
return () => {
RestClient.unsubscribe(onChangeTorStatus);
};
}, []);
if (visible) {
setTimeout(() => {
settorStatus(TorStatus.ERROR);
}, 5000);
}

// useEffect(() => {
// RestClient.subToTorStatus(onChangeTorStatus);
// return () => {
// RestClient.unsubscribe(onChangeTorStatus);
// };
// }, []);

return (
<>
Expand All @@ -109,15 +116,16 @@ function TorModalMap({ visible, close, onPressTryAgain }) {
title="Connection Error"
subTitle="This can be due to the network or other conditions "
subTitleColor="light.secondaryText"
buttonText="Try Again"
buttonText="Close"
buttonTextColor="light.white"
buttonCallback={() => {
onPressTryAgain();
// onPressTryAgain();
close();
}}
textColor="light.primaryText"
Content={TorConnectionFailed}
/>
<KeeperModal
{/* <KeeperModal
visible={visible && torStatus === TorStatus.CONNECTED}
close={close}
title="Tor Enabled Successfully!"
Expand All @@ -128,7 +136,7 @@ function TorModalMap({ visible, close, onPressTryAgain }) {
buttonCallback={close}
textColor="light.primaryText"
Content={TorEnabledContent}
/>
/> */}
</>
);
}
Expand Down
23 changes: 1 addition & 22 deletions src/screens/AppSettings/TorSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,10 @@ function TorSettings() {
subtitle="Some WiFi networks use settings that do not let your device connect to Tor. If you get constant errors, try changing to mobile network or check your network settings"
/>
</Box>
{/* <TorModalMap
<TorModalMap
onPressTryAgain={handleInAppTor}
visible={showTorModal}
close={() => setShowTorModal(false)}
/> */}
<KeeperModal
visible={showTorModal}
close={() => {
setShowTorModal(false);
}}
title="Tor Error"
subTitle=""
buttonText="Okay"
buttonCallback={() => {
setShowTorModal(false);
}}
Content={() => (
<Box alignItems="center">
<Box marginTop={2}>
<Text color="light.greenText" fontSize={13} letterSpacing={0.65}>
{`Connection Failed! Whirlpool error with tor`}
</Text>
</Box>
</Box>
)}
/>
<KeeperModal
visible={showOrbotTorModal}
Expand Down

0 comments on commit 7d5f16b

Please sign in to comment.