From a6c068518442c3bba3ed1ae0e9fe14ceabbc5972 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 25 Aug 2023 10:53:42 +0200 Subject: [PATCH] #633 - Fix custom taxonomy used as single value --- CHANGELOG.md | 1 + .../components/TaxonomyView/TaxonomyManager.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79dcb4c1..aba49433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### 🐞 Fixes - [#628](https://github.com/estruyf/vscode-front-matter/issues/628): Fix path argument and JSON data on custom scripts +- [#633](https://github.com/estruyf/vscode-front-matter/issues/633): Fix custom taxonomy used as single value ## [9.0.0] - 2023-08-21 - [Release notes](https://beta.frontmatter.codes/updates/v9.0.0) diff --git a/src/dashboardWebView/components/TaxonomyView/TaxonomyManager.tsx b/src/dashboardWebView/components/TaxonomyView/TaxonomyManager.tsx index 4bb04241..6c459b0a 100644 --- a/src/dashboardWebView/components/TaxonomyView/TaxonomyManager.tsx +++ b/src/dashboardWebView/components/TaxonomyView/TaxonomyManager.tsx @@ -97,6 +97,10 @@ export const TaxonomyManager: React.FunctionComponent = ( } } + if (typeof values === 'string') { + values = [values]; + } + for (const value of values) { if (!items.includes(value)) { unmapped.push(value); @@ -111,6 +115,8 @@ export const TaxonomyManager: React.FunctionComponent = ( return null; } + console.log('items', unmappedItems); + return (