1
0
Fork 0

Fix #127: Avoid requesting relationships without providing ids.

This commit is contained in:
Nicolas Perriault 2017-05-05 23:47:25 +02:00
parent fcfa767b91
commit 50ee7646fd
No known key found for this signature in database
GPG Key ID: DA5E4C83904F7A2A
2 changed files with 10 additions and 7 deletions

View File

@ -230,13 +230,16 @@ requestRelationships client ids =
loadRelationships : Maybe Client -> List Int -> Cmd Msg
loadRelationships client ids =
case client of
Just client ->
requestRelationships client ids
|> send (MastodonEvent << AccountRelationships)
if List.length ids > 0 then
case client of
Just client ->
requestRelationships client ids
|> send (MastodonEvent << AccountRelationships)
Nothing ->
Cmd.none
Nothing ->
Cmd.none
else
Cmd.none
loadThread : Maybe Client -> Status -> Cmd Msg

View File

@ -670,7 +670,7 @@ processMastodonEvent msg model =
! [ Command.loadRelationships model.client <| List.map .id decoded ]
Err error ->
{ model | errors = (errorText error) :: model.errors } ! []
{ model | errors = (errorText (Debug.log "error" error)) :: model.errors } ! []
AccountFollowing result ->
case result of