From 912b0adddc963993ab67be1f372d602e443ea92a Mon Sep 17 00:00:00 2001 From: PhilReact Date: Sun, 10 Dec 2023 14:17:20 +0200 Subject: [PATCH] change positioning --- src/pages/Store/Store/Store.tsx | 50 +++++++++++++++++---------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/pages/Store/Store/Store.tsx b/src/pages/Store/Store/Store.tsx index 8b96ffa..c055e25 100644 --- a/src/pages/Store/Store/Store.tsx +++ b/src/pages/Store/Store/Store.tsx @@ -189,6 +189,32 @@ export const Store = () => { : 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 ()=> { 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 (