parent
f25b287926
commit
99eae108c7
14
src/Main.elm
14
src/Main.elm
|
@ -110,10 +110,7 @@ submitQuery :
|
||||||
submitQuery old ( new, cmd ) =
|
submitQuery old ( new, cmd ) =
|
||||||
let
|
let
|
||||||
triggerSearch oldModel newModel msg makeRequest =
|
triggerSearch oldModel newModel msg makeRequest =
|
||||||
if (oldModel.query == newModel.query) && RemoteData.isSuccess oldModel.result then
|
if newModel.query /= Nothing then
|
||||||
( new, cmd )
|
|
||||||
|
|
||||||
else
|
|
||||||
( new
|
( new
|
||||||
, Cmd.batch
|
, Cmd.batch
|
||||||
[ cmd
|
[ cmd
|
||||||
|
@ -123,14 +120,23 @@ submitQuery old ( new, cmd ) =
|
||||||
|> Cmd.map msg
|
|> Cmd.map msg
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
else
|
||||||
|
( new, cmd )
|
||||||
in
|
in
|
||||||
case ( old.page, new.page ) of
|
case ( old.page, new.page ) of
|
||||||
( Packages oldModel, Packages newModel ) ->
|
( Packages oldModel, Packages newModel ) ->
|
||||||
triggerSearch oldModel newModel PackagesMsg Page.Packages.makeRequest
|
triggerSearch oldModel newModel PackagesMsg Page.Packages.makeRequest
|
||||||
|
|
||||||
|
( NotFound, Packages newModel ) ->
|
||||||
|
triggerSearch newModel newModel PackagesMsg Page.Packages.makeRequest
|
||||||
|
|
||||||
( Options oldModel, Options newModel ) ->
|
( Options oldModel, Options newModel ) ->
|
||||||
triggerSearch oldModel newModel OptionsMsg Page.Options.makeRequest
|
triggerSearch oldModel newModel OptionsMsg Page.Options.makeRequest
|
||||||
|
|
||||||
|
( NotFound, Options newModel ) ->
|
||||||
|
triggerSearch newModel newModel OptionsMsg Page.Options.makeRequest
|
||||||
|
|
||||||
( _, _ ) ->
|
( _, _ ) ->
|
||||||
( new, cmd )
|
( new, cmd )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue