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} /> setFee={setFee} />
<UnsignedFees <UnsignedFees
qortAddress={qortAddress} qortAddress={qortAddress}
selectedCoin={selectedCoin}
/> />
</> </>
)} )}

View File

@ -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]);

View File

@ -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
View File

@ -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>;