small fixes

This commit is contained in:
Simon Cambier
2024-10-26 11:07:21 +02:00
parent ec82bd29fa
commit efd99b67a0
3 changed files with 11 additions and 7 deletions

View File

@@ -12,7 +12,7 @@
import ResultItemContainer from './ResultItemContainer.svelte'
import type OmnisearchPlugin from '../main'
import { setIcon, TFile } from 'obsidian'
import { onMount, SvelteComponent } from 'svelte'
import { onMount } from 'svelte'
// Import icon utility functions
import {
@@ -165,7 +165,8 @@
{:else}
<!-- File Icon -->
{#if fileIconSVG}
<span class="omnisearch-result__icon" use:renderSVG="{fileIconSVG}"></span>
<span class="omnisearch-result__icon" use:renderSVG="{fileIconSVG}"
></span>
{/if}
{/if}
<span>
@@ -191,7 +192,8 @@
<div class="omnisearch-result__folder-path">
<!-- Folder Icon -->
{#if folderIconSVG}
<span class="omnisearch-result__icon" use:renderSVG="{folderIconSVG}"></span>
<span class="omnisearch-result__icon" use:renderSVG="{folderIconSVG}"
></span>
{/if}
<span>
{@html plugin.textProcessor.highlightText(notePath, matchesNotePath)}

View File

@@ -29,7 +29,7 @@ export class EmbedsRepository {
this.embeds.delete(oldPath)
}
// If the file is a note referencing other files
this.embeds.forEach((referencedBy, key) => {
this.embeds.forEach((referencedBy, _key) => {
if (referencedBy.has(oldPath)) {
referencedBy.delete(oldPath)
referencedBy.add(newPath)
@@ -38,7 +38,7 @@ export class EmbedsRepository {
}
public refreshEmbedsForNote(filePath: string): void {
this.embeds.forEach((referencedBy, key) => {
this.embeds.forEach((referencedBy, _key) => {
if (referencedBy.has(filePath)) {
referencedBy.delete(filePath)
}

View File

@@ -1,4 +1,4 @@
import { TFile, getIcon, normalizePath } from 'obsidian'
import { getIcon, normalizePath } from 'obsidian'
import type OmnisearchPlugin from '../main'
import {
isFileImage,
@@ -134,7 +134,9 @@ export async function loadIconSVG(
if (!prefix) {
// No prefix, assume it's an emoji or text
return `<span class="omnisearch-result__icon--emoji">${escapeHTML(name)}</span>`
return `<span class="omnisearch-result__icon--emoji">${escapeHTML(
name
)}</span>`
}
const iconPackName = prefixToIconPack[prefix]