Skip to content

Commit

Permalink
Include edited field after sent
Browse files Browse the repository at this point in the history
  • Loading branch information
easafe committed Jan 26, 2025
1 parent bb72f7d commit 2ae368b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Client/Im/Chat.purs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import Effect.Unsafe as EUN
import Flame as F
import Node.URL as NU
import Shared.DateTime (DateTimeWrapper(..))

import Shared.Element (ElementId(..))
import Shared.Im.Contact as SIC
import Shared.Markdown (Token(..))
Expand Down Expand Up @@ -74,12 +73,12 @@ enterBeforeSendMessage event model@{ messageEnter } =
pure Nothing

getMessage ImModel Aff (Maybe ImMessage)
getMessage model@{ selectedImage, imageCaption, chatting } = do
input ← liftEffect $ chatInput chatting
getMessage model = do
input ← liftEffect $ chatInput model.chatting
value ← liftEffect $ CCD.value input
pure <<< Just <<< BeforeSendMessage $ DM.maybe (Text value) toImage selectedImage
pure <<< Just <<< BeforeSendMessage $ DM.maybe (Text value) toImage model.selectedImage
where
toImage base64File = Image (DM.fromMaybe "" imageCaption) base64File
toImage base64File = Image (DM.fromMaybe "" model.imageCaption) base64File

--send message/image button
forceBeforeSendMessage ImModel MoreMessages
Expand Down Expand Up @@ -182,6 +181,7 @@ sendMessage
history
{ content = content
, status = Sent
, edited = true
}
| otherwise = history

Expand Down

0 comments on commit 2ae368b

Please sign in to comment.