From 2edfb5a20c9dc7a02b9743839619ca4ec3984614 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 19 Apr 2023 06:25:16 +0200 Subject: [PATCH] make sortId mandatory --- src/components/BotList.vue | 2 +- src/components/BotLogin.vue | 2 ++ src/types/auth.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/BotList.vue b/src/components/BotList.vue index ea86fc65..ea3fdd9b 100644 --- a/src/components/BotList.vue +++ b/src/components/BotList.vue @@ -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 }, diff --git a/src/components/BotLogin.vue b/src/components/BotLogin.vue index 1dc053cf..4de26496 100644 --- a/src/components/BotLogin.vue +++ b/src/components/BotLogin.vue @@ -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); diff --git a/src/types/auth.ts b/src/types/auth.ts index 1b358b71..e1e742ce 100644 --- a/src/types/auth.ts +++ b/src/types/auth.ts @@ -38,7 +38,7 @@ export interface BotDescriptor { botName: string; botId: string; botUrl: string; - sortId?: number; + sortId: number; } export interface BotDescriptors {