From 1eaa992d39692450d06abe03a90c0a2b1717d5cb Mon Sep 17 00:00:00 2001 From: Taehoon Moon Date: Wed, 20 Nov 2024 00:01:54 +0900 Subject: [PATCH] Update core note::update_content not to return None transition (#59) --- core/src/state/notebook/consume/note.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/state/notebook/consume/note.rs b/core/src/state/notebook/consume/note.rs index 8e09a99..3edf4be 100644 --- a/core/src/state/notebook/consume/note.rs +++ b/core/src/state/notebook/consume/note.rs @@ -127,11 +127,9 @@ pub async fn update_content( content: String, ) -> Result { let current = db.fetch_note_content(note_id.clone()).await?; - - if current == content { - Ok(NotebookTransition::None) - } else { + if current != content { db.update_note_content(note_id.clone(), content).await?; - Ok(NotebookTransition::UpdateNoteContent(note_id)) } + + Ok(NotebookTransition::UpdateNoteContent(note_id)) }