Skip to content

Commit

Permalink
fix: fixes obsidian icon definition
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jan 27, 2023
1 parent 0897e08 commit dc05aba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 703 deletions.
7 changes: 3 additions & 4 deletions src/icons/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import type { IconName } from "@fortawesome/fontawesome-svg-core";
/* import { RPG } from "./rpgawesome"; */
import type { AdmonitionIconDefinition, IconType } from "src/@types";
import type ObsidianAdmonition from "src/main";
import { Notice, setIcon } from "obsidian";
import { getIconIds, Notice, setIcon } from "obsidian";
import { type DownloadableIconPack, DownloadableIcons } from "./packs";
import { ObsidianIconNames, ObsidianIcons } from "./obsidian";

export { type DownloadableIconPack, DownloadableIcons };

Expand Down Expand Up @@ -73,7 +72,7 @@ export class IconManager {
...(this.plugin.data.useFontAwesome
? this.FONT_AWESOME_MAP.values()
: []),
...ObsidianIcons.map((name) => {
...getIconIds().map((name) => {
return { type: "obsidian" as IconType, name };
}),
...downloaded
Expand Down Expand Up @@ -121,7 +120,7 @@ export class IconManager {
return "font-awesome";
if (findIconDefinition({ iconName: str as IconName, prefix: "fab" }))
return "font-awesome";
if (ObsidianIcons.includes(str as ObsidianIconNames)) {
if (getIconIds().includes(str)) {
return "obsidian";
}
for (const [pack, icons] of Object.entries(this.DOWNLOADED)) {
Expand Down
Loading

0 comments on commit dc05aba

Please sign in to comment.