Browse Source

Fixed upload progress not always updating correctly in popup

master
Teknikode 3 years ago
parent
commit
40b81721d1
1 changed files with 25 additions and 3 deletions
  1. 25
    3
      scripts/background.js

+ 25
- 3
scripts/background.js View File

@@ -144,9 +144,31 @@ function addProcessItem(type, data) {

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

Loading…
Cancel
Save