0
votes

I'm creating a basic native chat app with elm-native-ui.

I can open or close the chat by clicking on a button that change the chatOpen boolean

activeChannelView =
    case chatOpen of
        True ->
            Maybe.map (\a -> chatView users a messages) activeChannel ? viewEmpty

        False ->
            Maybe.map (cardView users) activeChannel ? viewEmpty

on the False side, it’s working well but on the True side it says that viewEmpty needs to be a (String -> Node Msg) instead of being (Node Msg) but the left side (chatView user a messages) returns Node Msg

Check the error below

The right side of (?) is causing a type mismatch.

Maybe.map (\a -> chatView users a messages)  activeChannel ? viewEmpty

^^^^^^^^^
(?) is expecting the right side to be a:

String -> Node Msg

But the right side is:

    Node Msg

I suppose it means that: if activeChannel is (Just a), True returns (String -> Node Msg)

How is it possible to have this error since chatView is defined like that:

chatView : List User -> Request -> List String -> String -> Node Msg
1

1 Answers

1
votes

chatView takes four parameters and you are passing only three.