Commit 9427c3c8 authored by edwin's avatar edwin

remove get idarray on download listener

parent 00e12d50
......@@ -32,7 +32,7 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){
}
console.log("Current index : ", index);
console.log("Current noImages : " , noImages);
if(index >= skus.length-1) {
if(index >= skus.length) {
console.log("Last file was downloaded");
alert(noImages);
}
......@@ -40,16 +40,16 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){
chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) {
if(!skus.length){
chrome.storage.local.get('idArray', function (items) {
skus = items.idArray.split(',');
});
}
// if(!skus.length){
// chrome.storage.local.get('idArray', function (items) {
// skus = items.idArray.split(',');
// });
// }
var new_filename = skus[index] + ".zip";
suggest({filename: new_filename});
index++;
if(index >= skus.length-1) {
if(index >= skus.length) {
console.log("Last file was downloaded");
alert(noImages);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment