Skip to content

Commit

Permalink
fix task info
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Apr 24, 2024
1 parent eba785e commit 71d8b6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 3 additions & 7 deletions src/components/Elements/RegionCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,9 @@ const RegionCardInner = ({
</div>
<Divider orientation='vertical' flexItem />
<Box sx={{ color: theme.palette.grey[200] }}>
{taskId !== null ? (
<Typography variant='subtitle2'>
{`Task: ${getTask(taskId)}`}
</Typography>
) : (
<></>
)}
<Typography variant='subtitle2'>
{`Task: ${getTask(taskId)}`}
</Typography>
<Box
sx={{
display: 'flex',
Expand Down
14 changes: 11 additions & 3 deletions src/contexts/regions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ const RegionDataProvider = ({ children }: Props) => {
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(
Expand Down

0 comments on commit 71d8b6d

Please sign in to comment.