Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2983 from diox/dont-make-extra-useless-xhr
Browse files Browse the repository at this point in the history
Avoid useless XHR when #receipt-check-result is absent (bug 1035376)
  • Loading branch information
diox committed Mar 18, 2015
2 parents 819a8e4 + 7b37bab commit 2fb986b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions media/js/devreg/reviewers/editors.js
Expand Up @@ -182,7 +182,7 @@ function initReviewActions() {

function check_receipt() {
var $node = $('#receipt-check-result');
if ($node) {
if ($node.length) {
$.getJSON($node.data('url'), function(data) {
if (data.status) {
$node.text(gettext('Receipt checked by app.'));
Expand Down Expand Up @@ -227,9 +227,10 @@ function initQueue() {

var url = $q.attr('data-url');
var addon_ids = $.map($('.addon-row'), function(el) {
return $(el).attr('data-addon');
});
if(!(('localStorage' in window) && window.localStorage['dont_poll'])) {
return $(el).attr('data-addon');
});

if(!(('localStorage' in window) && window.localStorage.dont_poll)) {
(function checkCurrentlyViewing() {
$.post(url, {'addon_ids': addon_ids.join(',')}, function(data) {
$('#addon-queue .locked').removeClass('locked')
Expand Down

0 comments on commit 2fb986b

Please sign in to comment.