Merge branch 'main' of github.com:0PandaDEV/Qopy

This commit is contained in:
PandaDEV 2024-08-26 15:21:32 +10:00
commit 14fb5c37a9
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C
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..."> 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 => {

View file

@ -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 {