Skip to content

Commit

Permalink
don't show spinner when empty query is submitted
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed Jul 9, 2020
1 parent 08c5d99 commit 681d44c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Search.elm
Expand Up @@ -351,16 +351,20 @@ update path navKey result_type options decodeResultItemSource msg model =
)

QueryInputSubmit ->
( { model | result = RemoteData.Loading }
, createUrl
path
model.channel
model.query
model.show
0
model.size
|> Browser.Navigation.pushUrl navKey
)
if model.query == Nothing || model.query == Just "" then
( model, Cmd.none )

else
( { model | result = RemoteData.Loading }
, createUrl
path
model.channel
model.query
model.show
0
model.size
|> Browser.Navigation.pushUrl navKey
)

QueryResponse result ->
( { model | result = result }
Expand Down

0 comments on commit 681d44c

Please sign in to comment.