This commit is contained in:
PhilReact 2025-05-03 01:35:44 +03:00
parent d79e26da4b
commit 74ef469224
2 changed files with 25 additions and 5 deletions

View File

@ -824,7 +824,8 @@ export const TradeOffers: React.FC<any> = ({
gridRef.current.api.refreshCells({ force: true });
}
}, [signedUnlockingFees, fee]);
if (!signedUnlockingFees || (!fee && selectedCoin !== "PIRATECHAIN"))
if (!signedUnlockingFees || ((fee === undefined || fee === null) && selectedCoin !== "PIRATECHAIN"))
return null;
return (

View File

@ -86,7 +86,8 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
},
1800000
);
if (response && !isNaN(+response)) {
console.log('response', response)
if ((response !== null && response !== undefined) && !isNaN(+response)) {
setFee(response);
}
@ -120,6 +121,17 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
return recommendedFeeData[coin][recommendedFee];
}, [recommendedFeeData, recommendedFee, selectedCoin]);
const hideRecommendations = useMemo(()=> {
if(selectedCoin === 'LITECOIN' || selectedCoin === 'BITCOIN' || selectedCoin === 'DOGECOIN') return false
return true
}, [selectedCoin])
useEffect(()=> {
if(hideRecommendations){
setRecommendedFee('custom')
}
}, [hideRecommendations])
const updateFee = async () => {
const typeRequest = "feerequired";
@ -183,7 +195,9 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
getLatestFees();
}, [getLatestFees]);
if (!fee) return;
console.log('fee', fee)
if (fee === null || fee === undefined) return;
return (
<>
<ButtonBase
@ -249,7 +263,7 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
alignItems: 'center'
}}>
<CustomLabel htmlFor="standard-adornment-name">
Recommended fee selection
Recommended fee selection ( in sats)
</CustomLabel>
<Spacer height="10px" />
@ -260,9 +274,14 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
onChange={handleChange}
aria-label="Platform"
>
<ToggleButton value="l">Low</ToggleButton>
{!hideRecommendations && (
<>
<ToggleButton value="l">Low</ToggleButton>
<ToggleButton value="m">Medium</ToggleButton>
<ToggleButton value="h">High</ToggleButton>
</>
)}
<ToggleButton value="custom">Custom</ToggleButton>
</ToggleButtonGroup>
</Box>