Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var -> let/const #5798

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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