Publish: Handle reflecting-state not updated correctly.
Fixes 4385 (lbry-desktop) `Don't show upload progress if no file exists (shows 0% progress)` An undefined result exception was causing the reflecting-state update code to be missed, so Desktop still thinks the item is still reflecting and continues to show the "Uploading(0%)" status.
This commit is contained in:
parent
e6d89b0690
commit
85077f6f00
2 changed files with 30 additions and 26 deletions
28
dist/bundle.es.js
vendored
28
dist/bundle.es.js
vendored
|
@ -4758,19 +4758,21 @@ const doCheckReflectingFiles = () => (dispatch, getState) => {
|
|||
|
||||
Promise.all(promises).then(function (results) {
|
||||
results.forEach(function (res) {
|
||||
const fileListItem = res.items[0];
|
||||
const fileClaimId = fileListItem.claim_id;
|
||||
const {
|
||||
is_fully_reflected: done,
|
||||
uploading_to_reflector: uploading,
|
||||
reflector_progress: progress
|
||||
} = fileListItem;
|
||||
if (uploading) {
|
||||
newReflectingById[fileClaimId] = {
|
||||
fileListItem: fileListItem,
|
||||
progress,
|
||||
stalled: !done && !uploading
|
||||
};
|
||||
if (res.items[0]) {
|
||||
const fileListItem = res.items[0];
|
||||
const fileClaimId = fileListItem.claim_id;
|
||||
const {
|
||||
is_fully_reflected: done,
|
||||
uploading_to_reflector: uploading,
|
||||
reflector_progress: progress
|
||||
} = fileListItem;
|
||||
if (uploading) {
|
||||
newReflectingById[fileClaimId] = {
|
||||
fileListItem: fileListItem,
|
||||
progress,
|
||||
stalled: !done && !uploading
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}).then(function () {
|
||||
|
|
|
@ -395,19 +395,21 @@ export const doCheckReflectingFiles = () => (dispatch: Dispatch, getState: GetSt
|
|||
Promise.all(promises)
|
||||
.then(results => {
|
||||
results.forEach(res => {
|
||||
const fileListItem = res.items[0];
|
||||
const fileClaimId = fileListItem.claim_id;
|
||||
const {
|
||||
is_fully_reflected: done,
|
||||
uploading_to_reflector: uploading,
|
||||
reflector_progress: progress,
|
||||
} = fileListItem;
|
||||
if (uploading) {
|
||||
newReflectingById[fileClaimId] = {
|
||||
fileListItem: fileListItem,
|
||||
progress,
|
||||
stalled: !done && !uploading,
|
||||
};
|
||||
if (res.items[0]) {
|
||||
const fileListItem = res.items[0];
|
||||
const fileClaimId = fileListItem.claim_id;
|
||||
const {
|
||||
is_fully_reflected: done,
|
||||
uploading_to_reflector: uploading,
|
||||
reflector_progress: progress,
|
||||
} = fileListItem;
|
||||
if (uploading) {
|
||||
newReflectingById[fileClaimId] = {
|
||||
fileListItem: fileListItem,
|
||||
progress,
|
||||
stalled: !done && !uploading,
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue