mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-14 04:03:51 +00:00
Prevent using botbalance when it doesn't work
This commit is contained in:
parent
1d4121f38b
commit
f5c9fa0f79
|
@ -4,7 +4,7 @@
|
||||||
<label class="me-auto h3">Balance</label>
|
<label class="me-auto h3">Balance</label>
|
||||||
<div class="float-end d-flex flex-row">
|
<div class="float-end d-flex flex-row">
|
||||||
<b-button
|
<b-button
|
||||||
v-if="botStore.activeBot.botApiVersion >= 2.26"
|
v-if="canUseBotBalance"
|
||||||
size="sm"
|
size="sm"
|
||||||
:title="!showBotOnly ? 'Showing Account balance' : 'Showing Bot balance'"
|
:title="!showBotOnly ? 'Showing Account balance' : 'Showing Bot balance'"
|
||||||
@click="showBotOnly = !showBotOnly"
|
@click="showBotOnly = !showBotOnly"
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<!-- this is a computed prop that adds up all the expenses in the visible rows -->
|
<!-- this is a computed prop that adds up all the expenses in the visible rows -->
|
||||||
<td>
|
<td>
|
||||||
<strong>{{
|
<strong>{{
|
||||||
showBotOnly
|
showBotOnly && canUseBotBalance
|
||||||
? formatCurrency(botStore.activeBot.balance.total_bot)
|
? formatCurrency(botStore.activeBot.balance.total_bot)
|
||||||
: formatCurrency(botStore.activeBot.balance.total)
|
: formatCurrency(botStore.activeBot.balance.total)
|
||||||
}}</strong>
|
}}</strong>
|
||||||
|
@ -76,13 +76,15 @@ const smallBalance = computed<number>(() => {
|
||||||
return Number((1.1 ** botStore.activeBot.stakeCurrencyDecimals).toFixed(8));
|
return Number((1.1 ** botStore.activeBot.stakeCurrencyDecimals).toFixed(8));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const canUseBotBalance = computed(() => {
|
||||||
|
return botStore.activeBot.botApiVersion >= 2.26;
|
||||||
|
});
|
||||||
|
|
||||||
const balanceCurrencies = computed(() => {
|
const balanceCurrencies = computed(() => {
|
||||||
return botStore.activeBot.balance.currencies?.filter(
|
return botStore.activeBot.balance.currencies?.filter(
|
||||||
(v) =>
|
(v) =>
|
||||||
(!hideSmallBalances.value || v.est_stake >= smallBalance.value) &&
|
(!hideSmallBalances.value || v.est_stake >= smallBalance.value) &&
|
||||||
(botStore.activeBot.botApiVersion < 2.26 ||
|
(!canUseBotBalance.value || !showBotOnly.value || (v.is_bot_managed ?? true) === true),
|
||||||
!showBotOnly.value ||
|
|
||||||
(v.is_bot_managed ?? true) === true),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -94,12 +96,12 @@ const tableFields = computed<TableField[]>(() => {
|
||||||
return [
|
return [
|
||||||
{ key: 'currency', label: 'Currency' },
|
{ key: 'currency', label: 'Currency' },
|
||||||
{
|
{
|
||||||
key: showBotOnly.value ? 'bot_owned' : 'free',
|
key: showBotOnly.value && canUseBotBalance.value ? 'bot_owned' : 'free',
|
||||||
label: 'Available',
|
label: 'Available',
|
||||||
formatter: formatCurrency,
|
formatter: formatCurrency,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: showBotOnly.value ? 'est_stake_bot' : 'est_stake',
|
key: showBotOnly.value && canUseBotBalance.value ? 'est_stake_bot' : 'est_stake',
|
||||||
label: `in ${botStore.activeBot.balance.stake}`,
|
label: `in ${botStore.activeBot.balance.stake}`,
|
||||||
formatter: formatCurrency,
|
formatter: formatCurrency,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user