Rebrand ForceBuy to ForceEntry

This commit is contained in:
Matthias 2022-05-25 19:20:18 +02:00
parent 2f2e88b8ec
commit 136d3f257a
3 changed files with 16 additions and 16 deletions

View File

@ -63,7 +63,7 @@ forceexit
>
<PlayIcon />
</button>
<ForceBuyForm :modal-show="forcebuyShow" @close="$bvModal.hide('forcebuy-modal')" />
<ForceEntryForm :modal-show="forcebuyShow" @close="$bvModal.hide('forceentry-modal')" />
</div>
</template>
@ -75,14 +75,14 @@ import PauseIcon from 'vue-material-design-icons/Pause.vue';
import ReloadIcon from 'vue-material-design-icons/Reload.vue';
import ForceExitIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
import ForceEntryIcon from 'vue-material-design-icons/PlusBoxMultipleOutline.vue';
import ForceBuyForm from './ForceBuyForm.vue';
import ForceEntryForm from './ForceEntryForm.vue';
import { defineComponent, computed, ref } from '@vue/composition-api';
import { useBotStore } from '@/stores/ftbotwrapper';
export default defineComponent({
name: 'BotControls',
components: {
ForceBuyForm,
ForceEntryForm,
PlayIcon,
StopIcon,
PauseIcon,
@ -99,7 +99,7 @@ export default defineComponent({
});
const initiateForceenter = () => {
root.$bvModal.show('forcebuy-modal');
root.$bvModal.show('forceentry-modal');
};
const handleStopBot = () => {

View File

@ -1,12 +1,12 @@
<template>
<div>
<b-modal
id="forcebuy-modal"
id="forceentry-modal"
ref="modal"
title="Force entering a trade"
@show="resetForm"
@hidden="resetForm"
@ok="handleBuy"
@ok="handleEntry"
>
<form ref="form" @submit.stop.prevent="handleSubmit">
<b-form-group
@ -28,7 +28,7 @@
id="pair-input"
v-model="pair"
required
@keydown.enter.native="handleBuy"
@keydown.enter.native="handleEntry"
></b-form-input>
</b-form-group>
<b-form-group
@ -41,7 +41,7 @@
v-model="price"
type="number"
step="0.00000001"
@keydown.enter.native="handleBuy"
@keydown.enter.native="handleEntry"
></b-form-input>
</b-form-group>
<b-form-group
@ -55,7 +55,7 @@
v-model="stakeAmount"
type="number"
step="0.000001"
@keydown.enter.native="handleBuy"
@keydown.enter.native="handleEntry"
></b-form-input>
</b-form-group>
<b-form-group
@ -85,7 +85,7 @@ import { ForceEnterPayload, OrderSides } from '@/types';
import { defineComponent, ref, nextTick } from '@vue/composition-api';
export default defineComponent({
name: 'ForceBuyForm',
name: 'ForceEntryForm',
setup(_, { root }) {
const botStore = useBotStore();
@ -107,7 +107,7 @@ export default defineComponent({
if (!checkFormValidity()) {
return;
}
// call forcebuy
// call forceentry
const payload: ForceEnterPayload = { pair: pair.value };
if (price.value) {
payload.price = Number(price.value);
@ -121,9 +121,9 @@ export default defineComponent({
if (botStore.activeBot.botApiVersion >= 2.13 && botStore.activeBot.shortAllowed) {
payload.side = orderSide.value;
}
botStore.activeBot.forcebuy(payload);
botStore.activeBot.forceentry(payload);
nextTick(() => {
root.$bvModal.hide('forcebuy-modal');
root.$bvModal.hide('forceentry-modal');
});
};
const resetForm = () => {
@ -141,7 +141,7 @@ export default defineComponent({
}
};
const handleBuy = (bvModalEvt) => {
const handleEntry = (bvModalEvt) => {
// Prevent modal from closing
bvModalEvt.preventDefault();
// Trigger submit handler
@ -151,7 +151,7 @@ export default defineComponent({
handleSubmit,
botStore,
form,
handleBuy,
handleEntry,
resetForm,
pair,
price,

View File

@ -616,7 +616,7 @@ export function createBotSubStore(botId: string, botName: string) {
return Promise.reject(error);
}
},
async forcebuy(payload: ForceEnterPayload) {
async forceentry(payload: ForceEnterPayload) {
if (payload && payload.pair) {
try {
// TODO: Update forcebuy to forceenter ...