File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import Checkbox from "./checkbox";
99import Flex from "./flex" ;
1010import Stack from "./stack" ;
1111import EventManager from "src/event/event-manager" ;
12+ import { isArray } from "lodash" ;
1213
1314export default function ReactView ( ) {
1415 const [ folderPath , setFolderPath ] = React . useState < string > ( "" ) ;
@@ -145,7 +146,16 @@ export default function ReactView() {
145146 const frontmatter = app . metadataCache . getFileCache (
146147 file as TFile
147148 ) ?. frontmatter ;
148- const tags : string [ ] = frontmatter ?. tags ?? [ ] ;
149+
150+ let tags : string [ ] = [ ] ;
151+ //Tags can be an array or just a string
152+ //This seems like a bug in Obsidian
153+ if ( typeof frontmatter ?. tags === "string" ) {
154+ tags = [ frontmatter ?. tags ] ;
155+ } else if ( Array . isArray ( frontmatter ?. tags ) ) {
156+ tags = frontmatter ?. tags ;
157+ }
158+
149159 const url : string | null = frontmatter ?. [ urlPropertyName ] ?? null ;
150160 const favorite = frontmatter ?. [ favoritePropertyName ] ?? false ;
151161 const source = frontmatter ?. [ sourcePropertyName ] ?? null ;
You can’t perform that action at this time.
0 commit comments