diff --git a/src/components/organisms/AssetActions/Pool/index.tsx b/src/components/organisms/AssetActions/Pool/index.tsx index 5e59b49f6..dada2f442 100644 --- a/src/components/organisms/AssetActions/Pool/index.tsx +++ b/src/components/organisms/AssetActions/Pool/index.tsx @@ -54,7 +54,6 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { const [showAdd, setShowAdd] = useState(false) const [showRemove, setShowRemove] = useState(false) - const [isLoading, setIsLoading] = useState(true) // TODO: put all these variables behind some useEffect // to prevent unneccessary updating on every render @@ -76,8 +75,6 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { if (!ocean || !accountId || !price || !price.value) return async function init() { - setIsLoading(true) - try { // // Get everything which is in the pool @@ -116,8 +113,6 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { setSwapFee(`${Number(swapFee) * 100}`) } catch (error) { Logger.error(error.message) - } finally { - setIsLoading(false) } } init() @@ -125,9 +120,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { return ( <> - {isLoading && !userLiquidity ? ( - - ) : showAdd ? ( + {showAdd ? (
={' '} - - + +
Pool @@ -174,8 +167,8 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { } - ocean={`${userLiquidity.ocean}`} - dt={`${userLiquidity.datatoken}`} + ocean={`${userLiquidity?.ocean}` || '0'} + dt={`${userLiquidity?.datatoken}` || '0'} dtSymbol={dtSymbol} poolShares={poolTokens} conversion={totalUserLiquidityInOcean} @@ -186,8 +179,8 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {