mirror of
https://github.com/Qortal/q-trade.git
synced 2025-06-19 12:41:21 +00:00
fix types
This commit is contained in:
parent
dbf2c0394c
commit
d79e26da4b
@ -512,7 +512,6 @@ export const Header = ({
|
|||||||
setFee={setFee} />
|
setFee={setFee} />
|
||||||
<UnsignedFees
|
<UnsignedFees
|
||||||
qortAddress={qortAddress}
|
qortAddress={qortAddress}
|
||||||
selectedCoin={selectedCoin}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
@ -63,7 +63,9 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
|
|||||||
setInfo(null);
|
setInfo(null);
|
||||||
};
|
};
|
||||||
const coin = useMemo(() => {
|
const coin = useMemo(() => {
|
||||||
return getCoinLabel(selectedCoin)?.toLowerCase();
|
const coinLabel = getCoinLabel(selectedCoin)
|
||||||
|
if(typeof coinLabel !== 'string') return
|
||||||
|
return coinLabel?.toLowerCase();
|
||||||
}, [selectedCoin, getCoinLabel]);
|
}, [selectedCoin, getCoinLabel]);
|
||||||
|
|
||||||
const establishUpdateFeeForm = useCallback(async (coin) => {
|
const establishUpdateFeeForm = useCallback(async (coin) => {
|
||||||
@ -111,7 +113,9 @@ export const FeeManager = ({ selectedCoin, setFee, fee }) => {
|
|||||||
|
|
||||||
const recommendedFeeDisplay = useMemo(() => {
|
const recommendedFeeDisplay = useMemo(() => {
|
||||||
if (!selectedCoin || !recommendedFeeData) return null;
|
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
|
if(!recommendedFeeData[coin]) return null
|
||||||
return recommendedFeeData[coin][recommendedFee];
|
return recommendedFeeData[coin][recommendedFee];
|
||||||
}, [recommendedFeeData, recommendedFee, selectedCoin]);
|
}, [recommendedFeeData, recommendedFee, selectedCoin]);
|
||||||
|
@ -34,7 +34,7 @@ export interface IContextProps {
|
|||||||
isUsingGateway: boolean;
|
isUsingGateway: boolean;
|
||||||
selectedCoin: string;
|
selectedCoin: string;
|
||||||
setSelectedCoin: (val: any)=> void;
|
setSelectedCoin: (val: any)=> void;
|
||||||
getCoinLabel: ()=> string | null | void;
|
getCoinLabel: (val?: string)=> string | null | void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultState: IContextProps = {
|
const defaultState: IContextProps = {
|
||||||
|
2
src/global.d.ts
vendored
2
src/global.d.ts
vendored
@ -43,6 +43,8 @@ interface QortalRequestOptions {
|
|||||||
foreignBlockchain?: string;
|
foreignBlockchain?: string;
|
||||||
foreignAmount?: number;
|
foreignAmount?: number;
|
||||||
atAddress?: string;
|
atAddress?: string;
|
||||||
|
type?: string
|
||||||
|
value?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
declare function qortalRequest(options: QortalRequestOptions): Promise<any>;
|
declare function qortalRequest(options: QortalRequestOptions): Promise<any>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user