Skip to content

Commit

Permalink
fix: fix failure to update completion state
Browse files Browse the repository at this point in the history
Signed-off-by: Alan D. Tse <alandtse@gmail.com>
  • Loading branch information
alandtse committed Oct 5, 2019
1 parent a5898c9 commit fd7ef84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/scripts/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
diffsdone,
diffsdue
);
if (diffdisplayed) {
return;
}
var bestspdxid = spdx[0].spdxid;
if (diffsdone >= diffsdue) {
console.log("All diffs complete; showing %s", bestspdxid);
displayDiff(diffs[bestspdxid].html, diffs[bestspdxid].time);
if (!diffdisplayed)
displayDiff(diffs[bestspdxid].html, diffs[bestspdxid].time);
updateBubbleText("Diffing done");
} else if (bestspdxid === spdxid) {
console.log("Best diff %s received; we can display", bestspdxid);
displayDiff(diffs[bestspdxid].html, diffs[bestspdxid].time);
if (!diffdisplayed)
displayDiff(diffs[bestspdxid].html, diffs[bestspdxid].time);
updateBubbleText("Displaying diff");
}
break;
case "alive?":
Expand Down Expand Up @@ -216,7 +216,7 @@ function processLicenses(showBest, processTime = 0) {
displayDiff(diffs[license].html, diffs[license].time);
}
}
if (diffsdue === diffsdone) {
if (diffsdue <= diffsdone) {
updateProgressBar(1, 1, false);
updateBubbleText("Done");
}
Expand Down

0 comments on commit fd7ef84

Please sign in to comment.