Remove a deleted item from search results

When an item is deleted in detail view, the results must be updated to
reflect the new state. The results are now changed by removing the
corresponding item.

Fixes: #920
This commit is contained in:
eikek
2021-07-25 16:03:52 +02:00
parent df5b59a7ce
commit 782ca0fa4f
8 changed files with 61 additions and 17 deletions

View File

@ -331,10 +331,18 @@ updateItemDetail lmsg model =
( hm, hc, hs ) =
updateHome (Page.Home.Data.SetLinkTarget result.linkTarget) model_
( hm1, hc1, hs1 ) =
case result.removedItem of
Just removedId ->
updateHome (Page.Home.Data.RemoveItem removedId) hm
Nothing ->
( hm, hc, hs )
in
( hm
, Cmd.batch [ Cmd.map ItemDetailMsg result.cmd, hc ]
, Sub.batch [ Sub.map ItemDetailMsg result.sub, hs ]
( hm1
, Cmd.batch [ Cmd.map ItemDetailMsg result.cmd, hc, hc1 ]
, Sub.batch [ Sub.map ItemDetailMsg result.sub, hs, hs1 ]
)