mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
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:
@ -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 ]
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user