Skip to content

Commit

Permalink
v1.0.1 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriTheElk authored Dec 15, 2024
1 parent 7ec307a commit d68e4b3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "image-picker",
"name": "Image Picker",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Adds a UI panel for quickly selecting images that are in your vault.",
"author": "ari.the.elk",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "image-picker",
"version": "1.0.0",
"version": "1.0.1",
"description": "Easily find any image inside your vault",
"main": "dist/main.js",
"scripts": {
Expand Down
27 changes: 23 additions & 4 deletions src/ImagePickerSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,28 @@ export class ImagePickerSettingTab extends PluginSettingTab {
containerEl.createEl('hr')

const credits = containerEl.createEl('div')
credits.innerHTML = `
Built with 💚 by <a href="https://ari.the.elk.wtf">ari.the.elk</a><br />
📖 <a href="https://ari.the.elk.wtf/obsidian/plugins/image-picker">documentation</a><br />
💝 <a href="https://ari.the.elk.wtf/donate">donate</a>`

credits
.createEl('span', {
text: 'Built with 💚 by ',
})
.createEl('a', {
text: 'ari.the.elk',
href: 'https://ari.the.elk.wtf',
})

credits.createEl('br')

credits.createEl('a', {
text: '📖 documentation',
href: 'https://ari.the.elk.wtf/obsidian/plugins/image-picker',
})

credits.createEl('br')

credits.createEl('a', {
text: '💝 donate',
href: 'https://ari.the.elk.wtf/donate',
})
}
}
5 changes: 3 additions & 2 deletions src/client/ImagePickerView/ImagePickerView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { debounce, isEqual, truncate } from 'lodash'
import { useEffect, useState, useRef, useCallback, useMemo } from 'react'
import { Notice } from 'obsidian'
import { Notice, TFile } from 'obsidian'

import {
queryTokens,
Expand Down Expand Up @@ -107,7 +107,8 @@ export const ImagePickerView = () => {
const { queryTokens, remainingQuery } = searchQuery
return images
.filter((file) => {
const resource = app.vault.getResourcePath(file as any).toLowerCase()
const tfile = app.vault.getAbstractFileByPath(file.path)
const resource = app.vault.getResourcePath(tfile as TFile).toLowerCase()

if (!resource.includes(remainingQuery.toLowerCase())) return false

Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"1.0.0": "0.15.0"
"1.0.0": "0.15.0",
"1.0.1": "0.15.0"
}

0 comments on commit d68e4b3

Please sign in to comment.