Add "disable confirm dialog" for forced exits

This commit is contained in:
Matthias 2023-12-01 06:29:22 +01:00
parent 22c31ff100
commit 0ac7bbdc26
3 changed files with 12 additions and 1 deletions

View File

@ -111,6 +111,7 @@ const props = defineProps({
}); });
const botStore = useBotStore(); const botStore = useBotStore();
const router = useRouter(); const router = useRouter();
const settingsStore = useSettingsStore();
const currentPage = ref(1); const currentPage = ref(1);
const selectedItemIndex = ref(); const selectedItemIndex = ref();
const filterText = ref(''); const filterText = ref('');
@ -182,8 +183,12 @@ function forceExitHandler(item: Trade, ordertype: string | undefined = undefined
feTrade.value = item; feTrade.value = item;
confirmExitValue.value = ModalReasons.forceExit; confirmExitValue.value = ModalReasons.forceExit;
confirmExitText.value = `Really exit trade ${item.trade_id} (Pair ${item.pair}) using ${ordertype} Order?`; confirmExitText.value = `Really exit trade ${item.trade_id} (Pair ${item.pair}) using ${ordertype} Order?`;
removeTradeVisible.value = true;
feOrderType.value = ordertype; feOrderType.value = ordertype;
if (settingsStore.confirmDialog === true) {
removeTradeVisible.value = true;
} else {
forceExitExecuter();
}
} }
function forceExitExecuter() { function forceExitExecuter() {

View File

@ -32,6 +32,7 @@ export const useSettingsStore = defineStore('uiSettings', {
useHeikinAshiCandles: false, useHeikinAshiCandles: false,
notifications: notificationDefaults, notifications: notificationDefaults,
profitDistributionBins: 20, profitDistributionBins: 20,
confirmDialog: true,
}; };
}, },
getters: { getters: {

View File

@ -36,6 +36,11 @@
>Background sync</b-form-checkbox >Background sync</b-form-checkbox
> >
</b-form-group> </b-form-group>
<b-form-group description="Use confirmation dialogs when force-exiting a trade.">
<b-form-checkbox v-model="settingsStore.confirmDialog"
>Show Confirm Dialog for Trade Exits</b-form-checkbox
>
</b-form-group>
</div> </div>
<div class="d-flex flex-column border rounded p-2 mb-2 gap-2"> <div class="d-flex flex-column border rounded p-2 mb-2 gap-2">