ndb.get_notekey_by_id now returns NoteKey

Closes: https://github.com/damus-io/notedeck/pull/584
This commit is contained in:
Ken Sedgwick
2024-12-16 16:20:47 -08:00
committed by William Casarin
parent e1a55c6532
commit 926a3f80f4
2 changed files with 9 additions and 15 deletions

View File

@@ -49,10 +49,7 @@ pub fn root_note_id_from_selected_id<'a>(
txn: &'a Transaction,
selected_note_id: &'a [u8; 32],
) -> &'a [u8; 32] {
let selected_note_key = if let Ok(key) = ndb
.get_notekey_by_id(txn, selected_note_id)
.map(NoteKey::new)
{
let selected_note_key = if let Ok(key) = ndb.get_notekey_by_id(txn, selected_note_id) {
key
} else {
return selected_note_id;