Revert "Fix applauncher clipboard copy"

This reverts commit b0702cf2f2.
This commit is contained in:
Ly-sec 2025-08-08 23:30:26 +02:00
parent b0702cf2f2
commit 1ab05f8c65

View file

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