mirror of
https://github.com/florisboard/florisboard.git
synced 2024-09-20 03:52:18 +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()) {
|
if (prefs.clipboard.historyEnabled.get()) {
|
||||||
val historyElement = history().all.firstOrNull { it.type == ItemType.TEXT && it.text == newItem.text }
|
val historyElement = history().all.firstOrNull { it.type == ItemType.TEXT && it.text == newItem.text }
|
||||||
if (historyElement != null) {
|
if (historyElement != null) {
|
||||||
moveToTheBeginning(historyElement, newItem)
|
moveToTheBeginning(
|
||||||
|
oldItem = historyElement,
|
||||||
|
newItem = if (historyElement.isPinned) {
|
||||||
|
newItem.copy(isPinned = true)
|
||||||
|
} else {
|
||||||
|
newItem
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
insertClip(newItem)
|
insertClip(newItem)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user