fix incorrect file_list responses

This commit is contained in:
Jeremy Kauffman 2017-07-30 15:20:36 -04:00
parent f4bdabd5d8
commit d58990f240
3 changed files with 13 additions and 6 deletions

View file

@ -231,6 +231,8 @@ export function doStartDownload(uri, outpoint) {
return function(dispatch, getState) {
const state = getState();
if (!outpoint) { throw new Error("outpoint is required to begin a download"); }
const { downloadingByOutpoint = {} } = state.fileInfo;
if (downloadingByOutpoint[outpoint]) return;
@ -450,4 +452,4 @@ export function doPublish(params) {
lbry.publishDeprecated(params, null, success, failure);
});
};
}
}

View file

@ -30,7 +30,6 @@ export class SplashScreen extends React.PureComponent {
_updateStatusCallback(status) {
const startupStatus = status.startup_status;
console.log(status);
if (startupStatus.code == "started") {
// Wait until we are able to resolve a name before declaring
// that we are done.

View file

@ -416,10 +416,16 @@ lbry.file_list = function(params = {}) {
fileInfos => {
removePendingPublishIfNeeded({ name, channel_name, outpoint });
const dummyFileInfos = lbry
.getPendingPublishes()
.map(pendingPublishToDummyFileInfo);
resolve([...fileInfos, ...dummyFileInfos]);
//if a naked file_list call, append the pending file infos
if (!name && !channel_name && !outpoint) {
const dummyFileInfos = lbry
.getPendingPublishes()
.map(pendingPublishToDummyFileInfo);
resolve([...fileInfos, ...dummyFileInfos]);
} else {
resolve(fileInfos);
}
},
reject
);