mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-05 22:55:58 +00:00
Fix updating item list when there are no results
This commit is contained in:
parent
071ab60a5c
commit
77e8a51acd
@ -56,7 +56,9 @@ update key flags msg model =
|
|||||||
Nothing ->
|
Nothing ->
|
||||||
Cmd.none
|
Cmd.none
|
||||||
in
|
in
|
||||||
( { model | itemListModel = m2 }, Cmd.batch [ Cmd.map ItemCardListMsg c2, cmd ] )
|
( { model | itemListModel = m2 }
|
||||||
|
, Cmd.batch [ Cmd.map ItemCardListMsg c2, cmd ]
|
||||||
|
)
|
||||||
|
|
||||||
ItemSearchResp (Ok list) ->
|
ItemSearchResp (Ok list) ->
|
||||||
let
|
let
|
||||||
@ -72,10 +74,7 @@ update key flags msg model =
|
|||||||
, moreAvailable = list.groups /= []
|
, moreAvailable = list.groups /= []
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
if list.groups == [] then
|
if model.searchOffset == 0 then
|
||||||
( m, Cmd.none )
|
|
||||||
|
|
||||||
else if model.searchOffset == 0 then
|
|
||||||
update key flags (ItemCardListMsg (Comp.ItemCardList.SetResults list)) m
|
update key flags (ItemCardListMsg (Comp.ItemCardList.SetResults list)) m
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -112,9 +111,13 @@ doSearch : Flags -> Model -> ( Model, Cmd Msg )
|
|||||||
doSearch flags model =
|
doSearch flags model =
|
||||||
let
|
let
|
||||||
cmd =
|
cmd =
|
||||||
doSearchCmd flags model.searchOffset model.searchMenuModel
|
doSearchCmd flags 0 model.searchMenuModel
|
||||||
in
|
in
|
||||||
( { model | searchInProgress = True, viewMode = Listing }
|
( { model
|
||||||
|
| searchInProgress = True
|
||||||
|
, viewMode = Listing
|
||||||
|
, searchOffset = 0
|
||||||
|
}
|
||||||
, cmd
|
, cmd
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user