mirror of
https://github.com/Qortal/q-shop.git
synced 2025-02-01 07:42:21 +00:00
change positioning
This commit is contained in:
parent
98c5e7d37d
commit
912b0adddc
@ -189,6 +189,32 @@ export const Store = () => {
|
|||||||
: currentViewedStore
|
: currentViewedStore
|
||||||
}, [username, user?.name, currentStore, currentViewedStore])
|
}, [username, user?.name, currentStore, currentViewedStore])
|
||||||
|
|
||||||
|
const calculateARRRExchangeRate = async()=> {
|
||||||
|
try {
|
||||||
|
const url = '/crosschain/price/PIRATECHAIN?maxtrades=10&inverse=true'
|
||||||
|
const info = await fetch(url, {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const responseDataStore = await info.text();
|
||||||
|
|
||||||
|
const ratio = +responseDataStore /100000000
|
||||||
|
if(isNaN(ratio)) throw new Error('Cannot get exchange rate')
|
||||||
|
setExchangeRate(ratio)
|
||||||
|
} catch (error) {
|
||||||
|
dispatch(setPreferredCoin(CoinFilter.qort))
|
||||||
|
dispatch(
|
||||||
|
setNotification({
|
||||||
|
alertType: "error",
|
||||||
|
msg: "Cannot get exchange rate- reverted to QORT",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const switchCoin = async ()=> {
|
const switchCoin = async ()=> {
|
||||||
dispatch(setIsLoadingGlobal(true));
|
dispatch(setIsLoadingGlobal(true));
|
||||||
|
|
||||||
@ -623,31 +649,7 @@ export const Store = () => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const calculateARRRExchangeRate = async()=> {
|
|
||||||
try {
|
|
||||||
const url = '/crosschain/price/PIRATECHAIN?maxtrades=10&inverse=true'
|
|
||||||
const info = await fetch(url, {
|
|
||||||
method: "GET",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const responseDataStore = await info.text();
|
|
||||||
|
|
||||||
const ratio = +responseDataStore /100000000
|
|
||||||
if(isNaN(ratio)) throw new Error('Cannot get exchange rate')
|
|
||||||
setExchangeRate(ratio)
|
|
||||||
} catch (error) {
|
|
||||||
dispatch(setPreferredCoin(CoinFilter.qort))
|
|
||||||
dispatch(
|
|
||||||
setNotification({
|
|
||||||
alertType: "error",
|
|
||||||
msg: "Cannot get exchange rate- reverted to QORT",
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user