Skip to content
Permalink
Browse files

Merge pull request #216 from ChrisTurk/master

 Don't duplicate detailed HIT breakdown overlays if TVJS exists
  • Loading branch information...
Kadauchi committed Mar 22, 2019
2 parents 1a93463 + df439ae commit 0bdabbe57cf18c3c62f98a853c2df2c67428eeee
Showing with 10 additions and 2 deletions.
  1. +0 −1 background/turkerview.js
  2. +9 −0 mturk/turkerview/hit-reviews.js
  3. +1 −1 mturk/turkerview/return-reviews.js
@@ -49,7 +49,6 @@ async function GET_HIT_STATS({ payload }, sendResponse) {
});
}


chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
switch (request.type) {
case `GET_RETURN_REVIEWS`:
@@ -198,6 +198,15 @@ async function getDetailedHitData(requester_id, reward, title, assignableHitsCou
}

async function initHitReview(){
const tv_storage_check = localStorage.getItem(`tv-settings`) || null;

if (tv_storage_check){
const tv_last_active = moment(JSON.parse(tv_storage_check).last_sync).tz('America/Los_Angeles');
const diff = moment().tz('America/Los_Angeles').diff(tv_last_active, 'hours')
// TVJS is still installed on this user's machine (most likely) - don't add a 2nd return review dialog, we'll have TVJS defer to MTS later
if (diff < 36) return;
}

const [dom, props] = await Promise.all([
ReactDOM(`ShowModal`),
ReactProps(`ShowModal`)
@@ -300,7 +300,7 @@ function returnsApiExceptionHandler(exception){

async function initReturnReviews(){

const tv_storage_check = localStorage.getItem(`ztv-settings`) || null;
const tv_storage_check = localStorage.getItem(`tv-settings`) || null;

if (tv_storage_check){
const tv_last_active = moment(JSON.parse(tv_storage_check).last_sync).tz('America/Los_Angeles');

0 comments on commit 0bdabbe

Please sign in to comment.
You can’t perform that action at this time.