Skip to content

Commit

Permalink
Merge pull request #5798 from thelostone-mc/cross
Browse files Browse the repository at this point in the history
var -> let/const
  • Loading branch information
octavioamu authored Jan 15, 2020
2 parents 02e7b92 + d99a77f commit 23e47d1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1775,23 +1775,25 @@ var main = function() {

// if theres a pending submission for this issue, show the warning message
// if not, pull the data from the API
var isPending = false;
let isPending = false;

if (localStorage[document.issueURL]) {
// validate pending issue metadata
document.pendingIssueMetadata = JSON.parse(localStorage[document.issueURL]);
var is_metadata_valid = typeof document.pendingIssueMetadata != 'undefined' && document.pendingIssueMetadata !== null && typeof document.pendingIssueMetadata['timestamp'] != 'undefined';
const is_metadata_valid = typeof document.pendingIssueMetadata != 'undefined' &&
document.pendingIssueMetadata !== null &&
typeof document.pendingIssueMetadata['timestamp'] != 'undefined';

if (is_metadata_valid) {
// validate that the pending tx is within the last little while
var then = parseInt(document.pendingIssueMetadata['timestamp']);
var now = timestamp();
var acceptableTimeDeltaSeconds = 60 * 60; // 1 hour
var isWithinAcceptableTimeRange = (now - then) < acceptableTimeDeltaSeconds;
const then = parseInt(document.pendingIssueMetadata['timestamp']);
const now = timestamp();
const acceptableTimeDeltaSeconds = 60 * 60; // 1 hour
const isWithinAcceptableTimeRange = (now - then) < acceptableTimeDeltaSeconds;

if (isWithinAcceptableTimeRange) {
// update from web3
var txid = document.pendingIssueMetadata['txid'];
const txid = document.pendingIssueMetadata['txid'];

showWarningMessage(txid);
wait_for_tx_to_mine_and_then_ping_server();
Expand Down

0 comments on commit 23e47d1

Please sign in to comment.