20000: Refresh container record after cancel or resume to reduce flickering
[arvados-workbench2.git] / src / store / processes / processes-actions.ts
index cfda51ddc9fde7524d3e34b700f66d7f76a0b382..0b2de8373ca83769f9ee0d548e95530cba053ea2 100644 (file)
@@ -115,6 +115,10 @@ export const cancelRunningWorkflow = (uuid: string) =>
         try {
             const process = await services.containerRequestService.update(uuid, { priority: 0 });
             dispatch<any>(updateResources([process]));
+            if (process.containerUuid) {
+                const container = await services.containerService.get(process.containerUuid, false);
+                dispatch<any>(updateResources([container]));
+            }
             return process;
         } catch (e) {
             throw new Error('Could not cancel the process.');
@@ -126,6 +130,10 @@ export const resumeOnHoldWorkflow = (uuid: string) =>
         try {
             const process = await services.containerRequestService.update(uuid, { priority: 500 });
             dispatch<any>(updateResources([process]));
+            if (process.containerUuid) {
+                const container = await services.containerService.get(process.containerUuid, false);
+                dispatch<any>(updateResources([container]));
+            }
             return process;
         } catch (e) {
             throw new Error('Could not resume the process.');