unset is luna on marketConfig change
This commit is contained in:
parent
9a83a22239
commit
3139c7ed95
|
@ -168,6 +168,16 @@ export default function AdvancedTradeForm({
|
|||
}
|
||||
}, [tradeType, set])
|
||||
|
||||
useEffect(() => {
|
||||
if (marketConfig.baseSymbol == 'LUNA') {
|
||||
setIsLuna(true)
|
||||
setReduceOnly(true)
|
||||
} else {
|
||||
setIsLuna(false)
|
||||
setReduceOnly(false)
|
||||
}
|
||||
}, [marketConfig])
|
||||
|
||||
useEffect(() => {
|
||||
let condition
|
||||
switch (tradeType) {
|
||||
|
@ -224,11 +234,6 @@ export default function AdvancedTradeForm({
|
|||
: availableBalance
|
||||
}
|
||||
|
||||
if (marketConfig.baseSymbol == 'LUNA') {
|
||||
setIsLuna(true)
|
||||
setReduceOnly(true)
|
||||
}
|
||||
|
||||
const {
|
||||
max: maxQuote,
|
||||
deposits,
|
||||
|
@ -787,16 +792,18 @@ export default function AdvancedTradeForm({
|
|||
<span className="ml-2 rounded border border-th-primary px-1 py-0.5 text-xs text-th-primary">
|
||||
{initLeverage}x
|
||||
</span>
|
||||
{ isLuna ? (<Tooltip
|
||||
content={
|
||||
<div className="text-center">
|
||||
LUNA is currently in reduce only mode. No new positions may be entered.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<ExclamationIcon className="ml-2 h-5 w-5 text-th-primary" />
|
||||
</Tooltip>) : null }
|
||||
|
||||
{isLuna ? (
|
||||
<Tooltip
|
||||
content={
|
||||
<div className="text-center">
|
||||
LUNA is currently in reduce only mode. No new positions may be
|
||||
entered.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<ExclamationIcon className="ml-2 h-5 w-5 text-th-primary" />
|
||||
</Tooltip>
|
||||
) : null}
|
||||
</ElementTitle>
|
||||
{insufficientSol ? (
|
||||
<div className="mb-3 text-left">
|
||||
|
|
Loading…
Reference in New Issue