diff --git a/src/components/Elements/RegionCard/index.tsx b/src/components/Elements/RegionCard/index.tsx index ceddcf6b..273089e1 100644 --- a/src/components/Elements/RegionCard/index.tsx +++ b/src/components/Elements/RegionCard/index.tsx @@ -258,13 +258,9 @@ const RegionCardInner = ({ - {taskId !== null ? ( - - {`Task: ${getTask(taskId)}`} - - ) : ( - <> - )} + + {`Task: ${getTask(taskId)}`} + { localStorage.getItem(`region-${rawId}`) ?? `Region #${_regions.length + 1}`; - const task = tasks[rawId.toString()] - ? tasks[rawId.toString()] - : await _getTaskFromWorkloadId(region.getCore(), region.getMask()); + let task = tasks[rawId.toString()] ?? null; + + // If the region isn't still active it cannot be in the workload. + if (region.consumed(context) != 0) { + if (!task) { + task = await _getTaskFromWorkloadId( + region.getCore(), + region.getMask() + ); + } + } _regions.push( RegionMetadata.construct(