Skip to content

Commit

Permalink
fix: lucide not work on quick list
Browse files Browse the repository at this point in the history
  • Loading branch information
Postcount CI committed Jan 10, 2024
1 parent 001c4cc commit 611d725
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ModalListGates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, Modal } from 'obsidian'
import { App, getIcon, Modal } from 'obsidian'
import { createFormEditGate } from './fns/createFormEditGate'
import { openView } from './fns/openView'

Expand All @@ -20,8 +20,16 @@ export class ModalListGates extends Modal {
const container = contentEl.createEl('div', {
cls: 'open-gate--quick-list-item'
})
// @ts-ignore-next-line
container.createEl(`svg`, { cls: 'svg-icon' }).innerHTML = gate.icon

if (!gate.icon.startsWith('<svg')) {
const iconSvg = getIcon(gate.icon) ?? getIcon('link-external')!
iconSvg.classList.add('svg-icon')
container.appendChild(iconSvg)
} else {
//@ts-ignore-next-line
container.createEl('svg', { cls: 'svg-icon' }).innerHTML = gate.icon
}

container.createEl('span', { text: gate.title })

container.addEventListener('click', async () => {
Expand Down

0 comments on commit 611d725

Please sign in to comment.