Fix applauncher clipboard copy

This commit is contained in:
Ly-sec 2025-08-08 23:13:41 +02:00
parent 532c3a8395
commit b0702cf2f2

View file

@ -68,16 +68,11 @@ PanelWithOverlay {
}; };
const exists = clipboardHistory.find(item => // Always create a new image entry, even if identical to an existing one
item.type === 'image' && item.data === entry.data clipboardHistory = [entry].concat(clipboardHistory).slice(0, 20);
);
if (!exists) {
clipboardHistory = [entry, ...clipboardHistory].slice(0, 20);
root.updateFilter(); root.updateFilter();
} }
} }
}
if (!clipboardHistoryProcess.isLoading) { if (!clipboardHistoryProcess.isLoading) {
clipboardInitialized = true; clipboardInitialized = true;
@ -103,29 +98,19 @@ PanelWithOverlay {
}; };
const exists = clipboardHistory.find(item => { var newHistory = clipboardHistory.map(item => {
if (item.type === 'text') {
return item.content === content;
}
return item === content;
});
if (!exists) {
const newHistory = clipboardHistory.map(item => {
if (typeof item === 'string') { if (typeof item === 'string') {
return { return {
type: 'text', type: 'text',
content: item, content: item,
timestamp: new Date().getTime() timestamp: 0
}; };
} }
return item; return item;
}); });
clipboardHistory = [entry, ...newHistory].slice(0, 20); // Always add a new text entry, even if content matches an existing entry
} clipboardHistory = [entry].concat(newHistory).slice(0, 20);
} }
} else { } else {
@ -787,7 +772,7 @@ PanelWithOverlay {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: 1 height: Math.max(1, 1 * Theme.scale(screen))
color: Theme.outline color: Theme.outline
opacity: index === appList.count - 1 ? 0 : 0.10 opacity: index === appList.count - 1 ? 0 : 0.10
} }