Fixed status url may be missing in a toot.

This commit is contained in:
Nicolas Perriault 2017-05-14 15:12:04 +02:00
parent e9e9809f65
commit a7826c5c2b
No known key found for this signature in database
GPG Key ID: DA5E4C83904F7A2A
3 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ statusDecoder =
|> Pipe.required "spoiler_text" Decode.string
|> Pipe.required "tags" (Decode.list tagDecoder)
|> Pipe.required "uri" Decode.string
|> Pipe.required "url" Decode.string
|> Pipe.required "url" (Decode.nullable Decode.string)
|> Pipe.required "visibility" Decode.string

View File

@ -179,7 +179,7 @@ type alias Status =
, spoiler_text : String
, tags : List Tag
, uri : String
, url : String
, url : Maybe String
, visibility : String
}

View File

@ -150,7 +150,7 @@ statusActionsView status currentUser =
else
text ""
, a
[ class baseBtnClasses, href status.url, target "_blank" ]
[ class baseBtnClasses, href (Maybe.withDefault "#" status.url), target "_blank" ]
[ Common.icon "time", formatDate ]
]