Skip to content

Commit 428e3ef

Browse files
committed
more O_O checklist progress
1 parent 7cf9063 commit 428e3ef

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/core/src/fields/inputFields/fields/ImageListSuggester/ImageListSuggesterComponent.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@
5959
onclick: () => {
6060
const imagePath = value[index];
6161
62+
// in this case, using `.then()` is nicer than `await` and a try-catch block
6263
navigator.clipboard
6364
.writeText(imagePath)
6465
.then(() => {
6566
props.plugin.internal.showNotice('Image path copied to clipboard');
6667
})
6768
.catch(() => {
68-
props.plugin.internal.showNotice('Failed to copy image to clipboard');
69+
props.plugin.internal.showNotice('Failed to copy image path to clipboard');
6970
});
7071
},
7172
});

packages/obsidian/src/ObsUtils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import type { API as JsEngineAPI } from 'jsEngine/api/API';
2+
import type JsEnginePlugin from 'jsEngine/main';
3+
import type { Plugin } from 'obsidian';
24
import type { DataviewApi } from 'obsidian-dataview';
35
import type { Templater, TemplaterPlugin } from 'packages/obsidian/extraTypes/Templater';
46
import type MetaBindPlugin from 'packages/obsidian/src/main';
57

68
export function getDataViewPluginAPI(plugin: MetaBindPlugin): DataviewApi {
79
/* eslint-disable */
810
const dataViewPlugin = plugin.dependencyManager.checkDependency('dataview');
9-
return (dataViewPlugin as any).api as DataviewApi;
11+
return (dataViewPlugin as Plugin & { api: DataviewApi }).api;
1012
}
1113

1214
export function getJsEnginePluginAPI(plugin: MetaBindPlugin): JsEngineAPI {
1315
/* eslint-disable */
1416
const jsEnginePlugin = plugin.dependencyManager.checkDependency('js-engine');
15-
return (jsEnginePlugin as any).api as JsEngineAPI;
17+
return (jsEnginePlugin as JsEnginePlugin).api;
1618
}
1719

1820
export enum Templater_RunMode {

0 commit comments

Comments
 (0)