mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
added back paste functionality for text and files
This commit is contained in:
parent
6fac8dbdbf
commit
51828da0f1
2 changed files with 12 additions and 3 deletions
10
app.vue
10
app.vue
|
@ -5,7 +5,7 @@
|
||||||
spellcheck="false" class="search" type="text" placeholder="Type to filter entries...">
|
spellcheck="false" class="search" type="text" placeholder="Type to filter entries...">
|
||||||
<div class="bottom-bar">
|
<div class="bottom-bar">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img src="/Logo.svg" alt="">
|
<img class="logo" width="18px" src="/Logo.svg" alt="">
|
||||||
<p>Qopy</p>
|
<p>Qopy</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
|
@ -202,7 +202,8 @@ const pasteSelectedItem = async (): Promise<void> => {
|
||||||
if (!selectedItem.value) return;
|
if (!selectedItem.value) return;
|
||||||
|
|
||||||
let content = selectedItem.value.content;
|
let content = selectedItem.value.content;
|
||||||
if (selectedItem.value.content_type === 'image') {
|
let contentType: String = selectedItem.value.content_type;
|
||||||
|
if (contentType === 'image') {
|
||||||
try {
|
try {
|
||||||
content = readFile(content).toString();
|
content = readFile(content).toString();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -210,8 +211,11 @@ const pasteSelectedItem = async (): Promise<void> => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await invoke("write_and_paste", { content, content_type: selectedItem.value.content_type });
|
|
||||||
await hideApp();
|
await hideApp();
|
||||||
|
await invoke("write_and_paste", {
|
||||||
|
content,
|
||||||
|
contentType
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const truncateContent = (content: string): string => {
|
const truncateContent = (content: string): string => {
|
||||||
|
|
|
@ -201,6 +201,11 @@ body,
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue