fixup request status
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 35s Details

This commit is contained in:
Ladd Hoffman 2024-03-16 21:55:46 -05:00
parent bbaa0faf72
commit 90b7e67270
2 changed files with 16 additions and 16 deletions

View File

@ -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(),

View File

@ -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>