Browse Source

Removed uneccessary checking of type when updating item

master
Teknikode 3 years ago
parent
commit
22d60b04b5
1 changed files with 2 additions and 22 deletions
  1. 2
    22
      scripts/background.js

+ 2
- 22
scripts/background.js View File

@@ -145,28 +145,8 @@ function addProcessItem(type, data) {
function updateProcessItem(id, type, data) {
itemList.forEach(function(item) {
if (item.id === id) {
// certain ones override others
var allowUpdate = false;
switch (type) {
case 'progress':
if (item.type === 'progress') {
item.type = type;
item.data = data;
}
break;
case 'upload':
case 'paste':
case 'shorten':
if (item.type !== 'error') {
item.type = type;
item.data = data;
}
break;
case 'error':
item.type = type;
item.data = data;
break;
}
item.type = type;
item.data = data;
}
});
}

Loading…
Cancel
Save