Fix removing active clipboard item

This commit is contained in:
Aleksandras Kostarevas 2024-06-20 23:25:08 +03:00
parent ed550eec4b
commit aa025b92e8

View File

@ -329,7 +329,7 @@ class ClipboardHistoryManager(val context: Context, val coroutineScope: Lifecycl
// Clear the clipboard if the item being removed is the current one
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// TODO: URI
if(item.text != null && item.text == clipboardManager.primaryClip?.getItemAt(0)?.coerceToText(context)) {
if((item.text != null) && item.text == clipboardManager.primaryClip?.getItemAt(0)?.coerceToText(context)?.toString()) {
clipboardManager.clearPrimaryClip()
}
}