fixup request status
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 35s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 35s
Details
This commit is contained in:
parent
bbaa0faf72
commit
90b7e67270
|
@ -169,24 +169,9 @@ function App() {
|
|||
};
|
||||
|
||||
const fetchWorkRequest = async (requestIndex) => {
|
||||
const getRequestStatus = (request) => {
|
||||
switch (Number(request.status)) {
|
||||
case -1:
|
||||
return 'Requested';
|
||||
case 0:
|
||||
return 'Evidence Submitted';
|
||||
case 1:
|
||||
return 'Approval Submitted';
|
||||
case 2:
|
||||
return 'Complete';
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
};
|
||||
const r = await work1Contract.methods.requests(requestIndex).call();
|
||||
Object.assign(r, {
|
||||
id: Number(requestIndex),
|
||||
statusString: getRequestStatus(r),
|
||||
feeEther: web3.utils.fromWei(r.fee, 'ether'),
|
||||
currentUserIsCustomer: () => r.customer.toLowerCase()
|
||||
=== account.toString().toLowerCase(),
|
||||
|
|
|
@ -5,6 +5,21 @@ import Button from 'react-bootstrap/Button';
|
|||
import Web3 from 'web3';
|
||||
import Web3Context from './Web3Context';
|
||||
|
||||
const getRequestStatus = (request) => {
|
||||
switch (Number(request.status)) {
|
||||
case 0:
|
||||
return 'Requested';
|
||||
case 1:
|
||||
return 'Evidence Submitted';
|
||||
case 2:
|
||||
return 'Approval Submitted';
|
||||
case 3:
|
||||
return 'Complete';
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
};
|
||||
|
||||
function WorkRequests({ showRequestWork }) {
|
||||
const {
|
||||
provider, work1, work1Price, workRequests, availabilityStakes, account,
|
||||
|
@ -77,7 +92,7 @@ function WorkRequests({ showRequestWork }) {
|
|||
{' '}
|
||||
ETH
|
||||
</td>
|
||||
<td>{request.statusString}</td>
|
||||
<td>{getRequestStatus(request)}</td>
|
||||
<td>{request.stakeIndex.toString()}</td>
|
||||
<td>{request.approval.toString()}</td>
|
||||
<td>{request.poolIndex.toString()}</td>
|
||||
|
|
Loading…
Reference in New Issue