Skip to content

Commit

Permalink
Merge pull request #1858 from hypersign-protocol/stage
Browse files Browse the repository at this point in the history
Stage
  • Loading branch information
varsha766 authored Jan 10, 2023
2 parents 684dbd4 + 60b4da4 commit 5cb9b6c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ export default {
},
handleEventActionUpdate() {
// Code to update an Action
const data = {...this.prizeDetails}
if(data.hasOwnProperty('isDistributed') && data.isDistributed=== true) {
return this.notifyErr('Reward has been distributed for this prize you cannot edit it!')
}
let isvalid = this.handleEventActionValidation();
if (isvalid) {
this.selected.value = JSON.stringify(this.prizeDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ export default {
const returnOldTreeId = Number(oldTreeId) + 1
return returnOldTreeId
} catch (e) {
throw new Error(e)
throw new Error(e.message)
}
},
prizeCardSelectedForAirdrop(prize) {
Expand Down
8 changes: 5 additions & 3 deletions src/components/participant/ActionInputs/RewardClaimAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export default {
throw new Error("Reward already claimed");
}
} catch (e) {
this.notifyErr(e);
this.notifyErr(e.message);
} finally {
this.isLoading = false;
}
Expand Down Expand Up @@ -370,16 +370,18 @@ only screen and (max-width: 760px),
tr { border: 1px solid #dee2e6}
td {
border: none;
font-size: 0.9rem;
border-bottom: 1px solid #dee2e6;
position: relative;
padding-left: 50%;
padding-left: 60%;
}
th {
border: none;
font-size:1rem;
border-bottom: 1px solid #dee2e6;
background: #ccc;
position: relative;
padding-left: 50%;
padding-left: 60%;
}
td:before {
Expand Down
14 changes: 10 additions & 4 deletions src/mixins/getWeb3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Web3 from 'web3'

async function loadWeb3(inDecimal) {
async function loadWeb3(inDecimal) {
try{

if(window.ethereum){
const chain = Web3.utils.toHex(inDecimal);
window.web3 = new Web3(window.ethereum);
Expand Down Expand Up @@ -83,14 +85,18 @@ async function loadWeb3(inDecimal) {
}
}
}
await window.ethereum.request({ method: "eth_requestAccounts" });
return window.web3;
}else if(window.web3){
await window.ethereum.request({ method: "eth_requestAccounts" });
return window.web3;

}else if(window.web3){
window.web3 = new Web3(window.web3.currentProvider);
return window.web3;
}else{
throw new Error("Install Metamask browser extention");
}
}catch(e) {
throw new Error(e)
}
}

export default loadWeb3;

0 comments on commit 5cb9b6c

Please sign in to comment.