make sortId mandatory

This commit is contained in:
Matthias 2023-04-19 06:25:16 +02:00
parent a4ba5754f3
commit 2edfb5a20c
3 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,7 @@ import ReorderIcon from 'vue-material-design-icons/ReorderHorizontal.vue';
import { computed, ref } from 'vue';
import { useBotStore } from '@/stores/ftbotwrapper';
import { AuthStorageWithBotId, BotDescriptor } from '@/types';
import { useSortable, moveArrayElement } from '@vueuse/integrations/useSortable';
import { useSortable } from '@vueuse/integrations/useSortable';
defineProps({
small: { default: false, type: Boolean },

View File

@ -155,10 +155,12 @@ const handleSubmit = async () => {
emitLoginResult(true);
} else {
// Add new bot
const sortId = Object.keys(botStore.availableBots).length + 1;
botStore.addBot({
botName: auth.value.botName,
botId,
botUrl: auth.value.url,
sortId: sortId,
});
// switch to newly added bot
botStore.selectBot(botId);

View File

@ -38,7 +38,7 @@ export interface BotDescriptor {
botName: string;
botId: string;
botUrl: string;
sortId?: number;
sortId: number;
}
export interface BotDescriptors {