mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 19:08:26 +00:00
Update tag counts in search menu
This commit is contained in:
@ -19,6 +19,7 @@ module Page.Home.Data exposing
|
||||
import Api
|
||||
import Api.Model.BasicResult exposing (BasicResult)
|
||||
import Api.Model.ItemLightList exposing (ItemLightList)
|
||||
import Api.Model.SearchStats exposing (SearchStats)
|
||||
import Browser.Dom as Dom
|
||||
import Comp.FixedDropdown
|
||||
import Comp.ItemCardList
|
||||
@ -173,6 +174,7 @@ type Msg
|
||||
| DeleteAllResp (Result Http.Error BasicResult)
|
||||
| UiSettingsUpdated
|
||||
| SetLinkTarget LinkTarget
|
||||
| SearchStatsResp (Result Http.Error SearchStats)
|
||||
|
||||
|
||||
type SearchType
|
||||
@ -237,7 +239,10 @@ doSearchDefaultCmd param model =
|
||||
}
|
||||
in
|
||||
if param.offset == 0 then
|
||||
Api.itemSearch param.flags mask (ItemSearchResp param.scroll)
|
||||
Cmd.batch
|
||||
[ Api.itemSearch param.flags mask (ItemSearchResp param.scroll)
|
||||
, Api.itemSearchStats param.flags mask SearchStatsResp
|
||||
]
|
||||
|
||||
else
|
||||
Api.itemSearch param.flags mask ItemSearchAddResp
|
||||
|
@ -550,6 +550,13 @@ update mId key flags settings msg model =
|
||||
in
|
||||
update mId key flags settings (DoSearch model.lastSearchType) model_
|
||||
|
||||
SearchStatsResp result ->
|
||||
let
|
||||
lm =
|
||||
SearchMenuMsg (Comp.SearchMenu.GetStatsResp result)
|
||||
in
|
||||
update mId key flags settings lm model
|
||||
|
||||
|
||||
|
||||
--- Helpers
|
||||
|
Reference in New Issue
Block a user