fix: showing what core the chain is renewed on (#11256)
* fix: showing what core the chain is renewed on * removed the code that is part of another pr * better wording
This commit is contained in:
parent
bf8346e569
commit
e5b2b487fd
@ -132,15 +132,21 @@ function useCoretimeInformationImpl (api: ApiPromise, ready: boolean): CoretimeI
|
||||
const workloads = workloadData?.filter((one) => one.info.task === taskId);
|
||||
|
||||
const workTaskInfo = workloads.map((workload) => {
|
||||
const workplan = workplans?.filter((workplan) => workplan.core === workload?.core && workplan.info.task.toString() === taskId);
|
||||
// parachain can be renewed on a different core
|
||||
const workplan = workplans?.filter((workplan) => workplan.info.task.toString() === taskId);
|
||||
const type = getOccupancyType(lease, reservation, workload?.info.isPool ?? false);
|
||||
const chainRenewedCore = type === CoreTimeTypes['Bulk Coretime'] && workplan?.find((a) => a.core === workload?.core);
|
||||
const renewal = potentialRenewalsCurrentRegion?.find((renewal) => renewal.task.toString() === taskId);
|
||||
const renewalStatus = chainRenewedCore ? ChainRenewalStatus.Renewed : renewal ? ChainRenewalStatus.Eligible : ChainRenewalStatus.None;
|
||||
const potentialRenewal = potentialRenewalsCurrentRegion?.find((renewal) => renewal.task.toString() === taskId);
|
||||
|
||||
let renewalStatus = potentialRenewal ? ChainRenewalStatus.Eligible : ChainRenewalStatus.None;
|
||||
const chainRenewedCore = type === CoreTimeTypes['Bulk Coretime'] && !!workplan?.length;
|
||||
|
||||
if (chainRenewedCore) {
|
||||
renewalStatus = `Next cycle on core ${workplan[0].core}`;
|
||||
}
|
||||
|
||||
return {
|
||||
chainRenewedCore,
|
||||
renewal,
|
||||
renewal: potentialRenewal,
|
||||
renewalStatus,
|
||||
type,
|
||||
workload,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user