diff --git a/src/main/clipboard-history.ts b/src/main/clipboard-history.ts index 722050a5..a1744d8f 100644 --- a/src/main/clipboard-history.ts +++ b/src/main/clipboard-history.ts @@ -17,7 +17,7 @@ let createPreview = (item, input) => { let content = escapeHTML(item.value) if (item?.type === "image") { - return `
` + return `
` } let previewContent = @@ -191,18 +191,15 @@ if (text) { await sendWait(Channel.TOGGLE_WATCHER) } else if (text === "__authorize-clipboard__") { exit() - } else { - await removeClipboardItem(id) - if (isImage) { + } else if (isImage) { + await removeClipboardItem(id) await clipboard.writeImage(await readFile(text)) await hide() - await sendWait(Channel.KEYBOARD_PASTE) } else { await setSelectedText(text) exit() } - } } export {} diff --git a/src/main/scriptlet.ts b/src/main/scriptlet.ts index d7f7a5a0..504fb620 100644 --- a/src/main/scriptlet.ts +++ b/src/main/scriptlet.ts @@ -122,7 +122,18 @@ await setSelectedText(result)` return await run(quickPath) } case "template": { - const result = await template(formattedScriptlet) + const result = await template(formattedScriptlet, { + shortcuts: [ + { + name: "Submit", + key: `${cmd}+s`, + bar: "right", + onPress: (input) => { + submit(input) + } + } + ] + }); await setSelectedText(result) process.exit(0) break