Skip to content

Commit

Permalink
fix(List/Matrix View): 🐛 Break when an altField is found
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Dec 16, 2021
1 parent 2d164c1 commit 4c45603
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/MatrixView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,16 @@ export default class MatrixView extends ItemView {

getAlt(node: string): string | null {
const { altLinkFields } = this.plugin.settings;
let alt = null;
if (altLinkFields.length) {
const file = this.app.metadataCache.getFirstLinkpathDest(node, "");
if (file) {
const metadata = this.app.metadataCache.getFileCache(file);
altLinkFields.forEach((altLinkField) => {
alt = metadata?.frontmatter?.[altLinkField];
});
for (const altField of altLinkFields) {
const value = metadata?.frontmatter?.[altField];
if (value) return value;
}
}
}
return alt;
} else return null;
}

toInternalLinkObj = (
Expand Down

0 comments on commit 4c45603

Please sign in to comment.