mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
make sortId mandatory
This commit is contained in:
parent
a4ba5754f3
commit
2edfb5a20c
|
@ -43,7 +43,7 @@ import ReorderIcon from 'vue-material-design-icons/ReorderHorizontal.vue';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useBotStore } from '@/stores/ftbotwrapper';
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
||||||
import { AuthStorageWithBotId, BotDescriptor } from '@/types';
|
import { AuthStorageWithBotId, BotDescriptor } from '@/types';
|
||||||
import { useSortable, moveArrayElement } from '@vueuse/integrations/useSortable';
|
import { useSortable } from '@vueuse/integrations/useSortable';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
small: { default: false, type: Boolean },
|
small: { default: false, type: Boolean },
|
||||||
|
|
|
@ -155,10 +155,12 @@ const handleSubmit = async () => {
|
||||||
emitLoginResult(true);
|
emitLoginResult(true);
|
||||||
} else {
|
} else {
|
||||||
// Add new bot
|
// Add new bot
|
||||||
|
const sortId = Object.keys(botStore.availableBots).length + 1;
|
||||||
botStore.addBot({
|
botStore.addBot({
|
||||||
botName: auth.value.botName,
|
botName: auth.value.botName,
|
||||||
botId,
|
botId,
|
||||||
botUrl: auth.value.url,
|
botUrl: auth.value.url,
|
||||||
|
sortId: sortId,
|
||||||
});
|
});
|
||||||
// switch to newly added bot
|
// switch to newly added bot
|
||||||
botStore.selectBot(botId);
|
botStore.selectBot(botId);
|
||||||
|
|
|
@ -38,7 +38,7 @@ export interface BotDescriptor {
|
||||||
botName: string;
|
botName: string;
|
||||||
botId: string;
|
botId: string;
|
||||||
botUrl: string;
|
botUrl: string;
|
||||||
sortId?: number;
|
sortId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BotDescriptors {
|
export interface BotDescriptors {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user