Refresh item after addon is done

This commit is contained in:
eikek
2022-05-18 00:23:46 +02:00
parent 5abbe92f2b
commit 29a5894884
15 changed files with 123 additions and 19 deletions

View File

@ -314,13 +314,16 @@ updateWithSub msg model =
ReceiveWsMessage data ->
case data of
Ok (JobDone task) ->
Ok (JobDone details) ->
let
isProcessItem =
task == "process-item"
details.task == "process-item"
isDownloadZip =
task == "download-query-zip"
details.task == "download-query-zip"
isAddonExistingItem =
Data.ServerEvent.isAddonExistingItem model.itemDetailModel.detail.item.id details
newModel =
{ model
@ -337,6 +340,9 @@ updateWithSub msg model =
else if Page.isDashboardPage model.page && isProcessItem then
updateDashboard texts Page.Dashboard.Data.reloadDashboardData newModel
else if Page.isDetailPage model.page && isAddonExistingItem then
updateItemDetail texts (Page.ItemDetail.Data.ReloadItem True) newModel
else
( newModel, Cmd.none, Sub.none )