added back paste functionality for text and files

This commit is contained in:
0PandaDEV 2024-08-26 07:55:18 +10:00
parent 6fac8dbdbf
commit 51828da0f1
No known key found for this signature in database
2 changed files with 12 additions and 3 deletions

10
app.vue
View file

@ -5,7 +5,7 @@
spellcheck="false" class="search" type="text" placeholder="Type to filter entries...">
<div class="bottom-bar">
<div class="left">
<img src="/Logo.svg" alt="">
<img class="logo" width="18px" src="/Logo.svg" alt="">
<p>Qopy</p>
</div>
<div class="right">
@ -202,7 +202,8 @@ const pasteSelectedItem = async (): Promise<void> => {
if (!selectedItem.value) return;
let content = selectedItem.value.content;
if (selectedItem.value.content_type === 'image') {
let contentType: String = selectedItem.value.content_type;
if (contentType === 'image') {
try {
content = readFile(content).toString();
} catch (error) {
@ -210,8 +211,11 @@ const pasteSelectedItem = async (): Promise<void> => {
return;
}
}
await invoke("write_and_paste", { content, content_type: selectedItem.value.content_type });
await hideApp();
await invoke("write_and_paste", {
content,
contentType
});
};
const truncateContent = (content: string): string => {