Skip to content

Commit

Permalink
make fix
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Nov 11, 2018
1 parent 45987e1 commit 56405d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions app/assets/v2/js/metamask-approval.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ async function metamaskApproval() {
try {
if (is_metamask_unlocked && is_metamask_approved) {
var start_time = ((new Date()).getTime() / 1000);

await ethereum.enable();
var now_time = ((new Date()).getTime() / 1000);
var did_request_and_user_respond = (now_time - start_time) > 1.0;
if(did_request_and_user_respond){

if (did_request_and_user_respond) {
document.location.href = document.location.href;
}
}
Expand All @@ -26,10 +28,12 @@ window.addEventListener('load', metamaskApproval);
async function approve_metamask() {
try {
var start_time = ((new Date()).getTime() / 1000);

await ethereum.enable();
var now_time = ((new Date()).getTime() / 1000);
var did_request_and_user_respond = (now_time - start_time) > 1.0;
if(did_request_and_user_respond){

if (did_request_and_user_respond) {
document.location.href = document.location.href;
}
is_metamask_approved = true;
Expand Down
4 changes: 3 additions & 1 deletion app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,12 @@ var listen_for_web3_changes = async function() {
is_metamask_unlocked = await window.ethereum._metamask.isUnlocked();
if (is_metamask_approved && is_metamask_unlocked) {
var start_time = ((new Date()).getTime() / 1000);

await ethereum.enable();
var now_time = ((new Date()).getTime() / 1000);
var did_request_and_user_respond = (now_time - start_time) > 1.0;
if(did_request_and_user_respond){

if (did_request_and_user_respond) {
document.location.href = document.location.href;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.core.management.base import BaseCommand
from django.utils import timezone

from dashboard.models import Interest, Bounty
from dashboard.models import Bounty, Interest
from dashboard.views import record_user_action
from marketing.mails import start_work_applicant_about_to_expire, start_work_applicant_expired, start_work_approved

Expand Down

0 comments on commit 56405d6

Please sign in to comment.