From 11c8db0dce23eb5be48573edc75a508a46251ff1 Mon Sep 17 00:00:00 2001 From: Sunner Sun Date: Wed, 30 Aug 2023 09:49:56 +0800 Subject: [PATCH] feat: change bots menu tags to single selection --- src/components/Footer/BotsMenu.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Footer/BotsMenu.vue b/src/components/Footer/BotsMenu.vue index 1a401904b5..f3aff2824d 100644 --- a/src/components/Footer/BotsMenu.vue +++ b/src/components/Footer/BotsMenu.vue @@ -61,7 +61,6 @@ divided color="primary" group - multiple variant="outlined" rounded="xl" @update:model-value="filterBots($event)" @@ -115,6 +114,11 @@ function toggleMenu() { function filterBots(selectedTags) { let filteredIn = notDisabledBots; + // If the toggle is not multi-select, the selectedTags will be a string + if (typeof selectedTags === "string") { + selectedTags = [selectedTags]; + } + if (selectedTags.length) { const tagBots = selectedTags.map((tag) => botTags[tag]); filteredIn = filteredIn.filter((bot) => {