mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-06-19 09:35:42 +02:00
Fix for tags rendering on content cards
This commit is contained in:
+3
-9
@@ -1,18 +1,12 @@
|
||||
# Change Log
|
||||
|
||||
## [8.1.0] - 2022-xx-xx
|
||||
|
||||
### ✨ New features
|
||||
|
||||
### 🎨 Enhancements
|
||||
|
||||
- Fix `PSD` media card icon image
|
||||
|
||||
### ⚡️ Optimizations
|
||||
## [8.0.1] - 2022-07-13
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- Fix `PSD` media card icon image
|
||||
- Fix missing clipboard icon for the media card action
|
||||
- Fix in tags rendering on content cards
|
||||
|
||||
## [8.0.0] - 2022-07-11 - [Release notes](https://beta.frontmatter.codes/updates/v8.0.0)
|
||||
|
||||
|
||||
@@ -30,20 +30,23 @@ export const Item: React.FunctionComponent<IItemProps> = ({ fmFilePath, date, ti
|
||||
}
|
||||
|
||||
const tagField = settings.dashboardState.contents.tags;
|
||||
let tagsValue = [];
|
||||
|
||||
if (tagField === "tags") {
|
||||
return pageData.fmTags;
|
||||
tagsValue = pageData.fmTags;
|
||||
} else if (tagField === "categories") {
|
||||
return pageData.fmCategories;
|
||||
tagsValue = pageData.fmCategories;
|
||||
} else {
|
||||
tagsValue = pageData[tagField] || [];
|
||||
}
|
||||
|
||||
const tagsValue = pageData[tagField] || [];
|
||||
|
||||
if (Array.isArray(tagsValue)) {
|
||||
if (typeof tagsValue === "string") {
|
||||
return [tagsValue];
|
||||
} else if (Array.isArray(tagsValue)) {
|
||||
return tagsValue;
|
||||
}
|
||||
|
||||
return [tagsValue];
|
||||
return [];
|
||||
}, [settings, pageData]);
|
||||
|
||||
if (view === DashboardViewType.Grid) {
|
||||
@@ -119,4 +122,4 @@ export const Item: React.FunctionComponent<IItemProps> = ({ fmFilePath, date, ti
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user