Skip to content

Commit

Permalink
keep the user on the checkout page until the posts have had time to c…
Browse files Browse the repository at this point in the history
…omplete

#6947
  • Loading branch information
owocki committed Jun 22, 2020
1 parent 03c6bdb commit ac07d37
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/assets/v2/js/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,19 @@ Vue.component('grants-cart', {
localStorage.setItem('contributions_were_successful', 'true');
localStorage.setItem('contributions_count', String(this.grantData.length));
var network = document.web3network;
let timeout_amount = 1500 + (CartData.loadCart().length * 500)
_alert('Saving contributions. Please do not leave this page.', 'success', 2000);

setTimeout(function() {
if (network === 'rinkeby') {
window.location.href = `${window.location.origin}/grants/?network=rinkeby&category=`;
} else {
window.location.href = `${window.location.origin}/grants`;
}
}, 1500);
_alert('Contributions saved', 'success', 1000);
setTimeout(function(){
if (network === 'rinkeby') {
window.location.href = `${window.location.origin}/grants/?network=rinkeby&category=`;
} else {
window.location.href = `${window.location.origin}/grants`;
}
}, 500);
}, timeout_amount);
})
.on('error', (error, receipt) => {
// If the transaction was rejected by the network with a receipt, the second parameter will be the receipt.
Expand Down

0 comments on commit ac07d37

Please sign in to comment.