mirror of
https://github.com/florisboard/florisboard.git
synced 2024-09-19 19:42:20 +02:00
fix pinned items getting unpinned when copying the same content again
This commit is contained in:
parent
f7b65f788f
commit
5b8b73ff16
@ -224,7 +224,14 @@ class ClipboardManager(
|
||||
if (prefs.clipboard.historyEnabled.get()) {
|
||||
val historyElement = history().all.firstOrNull { it.type == ItemType.TEXT && it.text == newItem.text }
|
||||
if (historyElement != null) {
|
||||
moveToTheBeginning(historyElement, newItem)
|
||||
moveToTheBeginning(
|
||||
oldItem = historyElement,
|
||||
newItem = if (historyElement.isPinned) {
|
||||
newItem.copy(isPinned = true)
|
||||
} else {
|
||||
newItem
|
||||
}
|
||||
)
|
||||
} else {
|
||||
insertClip(newItem)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user