Merge pull request #997 from VASHvic/fix-clipboard-copy-edited-notes

Fix copying to clipboard edited notes
This commit is contained in:
Vitor Pamplona 2024-07-30 13:47:49 -04:00 committed by GitHub
commit bc8e5aa458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -188,8 +188,9 @@ fun NoteDropDownMenu(
DropdownMenuItem(
text = { Text(stringRes(R.string.copy_text)) },
onClick = {
val lastNoteVersion = (editState?.value as? GenericLoadable.Loaded)?.loaded?.modificationToShow?.value ?: note
scope.launch(Dispatchers.IO) {
accountViewModel.decrypt(note) { clipboardManager.setText(AnnotatedString(it)) }
accountViewModel.decrypt(lastNoteVersion) { clipboardManager.setText(AnnotatedString(it)) }
onDismiss()
}
},