fix types

This commit is contained in:
PhilReact 2025-05-03 00:12:56 +03:00
parent dbf2c0394c
commit d79e26da4b
4 changed files with 9 additions and 4 deletions

View File

@ -512,7 +512,6 @@ export const Header = ({
setFee={setFee} />
<UnsignedFees
qortAddress={qortAddress}
selectedCoin={selectedCoin}
/>
</>
)}

View File

@ -63,7 +63,9 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
setInfo(null);
};
const coin = useMemo(() => {
return getCoinLabel(selectedCoin)?.toLowerCase();
const coinLabel = getCoinLabel(selectedCoin)
if(typeof coinLabel !== 'string') return
return coinLabel?.toLowerCase();
}, [selectedCoin, getCoinLabel]);
const establishUpdateFeeForm = useCallback(async (coin) => {
@ -111,7 +113,9 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
const recommendedFeeDisplay = useMemo(() => {
if (!selectedCoin || !recommendedFeeData) return null;
const coin = getCoinLabel(selectedCoin)?.toUpperCase();
const coinLabel = getCoinLabel(selectedCoin)
if(typeof coinLabel !== 'string') return
const coin = coinLabel?.toUpperCase();
if(!recommendedFeeData[coin]) return null
return recommendedFeeData[coin][recommendedFee];
}, [recommendedFeeData, recommendedFee, selectedCoin]);

View File

@ -34,7 +34,7 @@ export interface IContextProps {
isUsingGateway: boolean;
selectedCoin: string;
setSelectedCoin: (val: any)=> void;
getCoinLabel: ()=> string | null | void;
getCoinLabel: (val?: string)=> string | null | void;
}
const defaultState: IContextProps = {

2
src/global.d.ts vendored
View File

@ -43,6 +43,8 @@ interface QortalRequestOptions {
foreignBlockchain?: string;
foreignAmount?: number;
atAddress?: string;
type?: string
value?: string
}
declare function qortalRequest(options: QortalRequestOptions): Promise<any>;