don't show spinner when empty query is submitted (#128)

This commit is contained in:
Rok Garbas 2020-07-09 18:15:34 +02:00 committed by GitHub
parent 5cc46b4e11
commit a3ed2036cb
Failed to generate hash of commit

View file

@ -352,16 +352,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 }