Update part3
This commit is contained in:
@@ -95,7 +95,7 @@ username : Author -> Username
|
||||
username author =
|
||||
case author of
|
||||
IsViewer cred _ ->
|
||||
cred.username
|
||||
Cred.username cred
|
||||
|
||||
IsFollowing (FollowedAuthor val _) ->
|
||||
val
|
||||
@@ -169,19 +169,19 @@ requestHelp builderFromUrl uname cred =
|
||||
|> HttpBuilder.toRequest
|
||||
|
||||
|
||||
followButton : (UnfollowedAuthor -> msg) -> UnfollowedAuthor -> Html msg
|
||||
followButton toMsg ((UnfollowedAuthor uname _) as author) =
|
||||
followButton : (Cred -> UnfollowedAuthor -> msg) -> Cred -> UnfollowedAuthor -> Html msg
|
||||
followButton toMsg cred ((UnfollowedAuthor uname _) as author) =
|
||||
toggleFollowButton "Follow"
|
||||
[ "btn-outline-secondary" ]
|
||||
(toMsg author)
|
||||
(toMsg cred author)
|
||||
uname
|
||||
|
||||
|
||||
unfollowButton : (FollowedAuthor -> msg) -> FollowedAuthor -> Html msg
|
||||
unfollowButton toMsg ((FollowedAuthor uname _) as author) =
|
||||
unfollowButton : (Cred -> FollowedAuthor -> msg) -> Cred -> FollowedAuthor -> Html msg
|
||||
unfollowButton toMsg cred ((FollowedAuthor uname _) as author) =
|
||||
toggleFollowButton "Unfollow"
|
||||
[ "btn-secondary" ]
|
||||
(toMsg author)
|
||||
(toMsg cred author)
|
||||
uname
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ decodeFromPair maybeCred ( prof, uname ) =
|
||||
Decode.succeed (IsNotFollowing (UnfollowedAuthor uname prof))
|
||||
|
||||
Just cred ->
|
||||
if uname == cred.username then
|
||||
if uname == Cred.username cred then
|
||||
Decode.succeed (IsViewer cred prof)
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user