From c34811e05b9ecf93e7707b78fbf2180e0a06963d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 1 Mar 2024 16:15:06 -0500 Subject: [PATCH] Tries to highlight that there are two states here for Compose to observe. --- .../java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index 9f38ee16e..50394e144 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -1416,7 +1416,8 @@ fun RenderTextEvent( val subject = (note.event as? TextNoteEvent)?.subject()?.ifEmpty { null } val newBody = if (editState.value is GenericLoadable.Loaded) { - (editState.value as? GenericLoadable.Loaded)?.loaded?.modificationToShow?.value?.event?.content() ?: body + val state = (editState.value as? GenericLoadable.Loaded)?.loaded?.modificationToShow + state?.value?.event?.content() ?: body } else { body }