-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4148 from lbryio/feat-trackReflectingFiles
track reflecting files after publish
- Loading branch information
Showing
13 changed files
with
95 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { connect } from 'react-redux'; | ||
import { makeSelectReflectingClaimForUri, doCheckReflectingFiles } from 'lbry-redux'; | ||
import PublishPending from './view'; | ||
|
||
const select = (state, props) => ({ | ||
reflectingInfo: props.uri && makeSelectReflectingClaimForUri(props.uri)(state), | ||
}); | ||
|
||
const perform = dispatch => ({ | ||
checkReflecting: () => dispatch(doCheckReflectingFiles()), | ||
}); | ||
|
||
export default connect(select, perform)(PublishPending); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
import Lbry from 'lbry-redux'; | ||
import Button from 'component/button'; | ||
|
||
type Props = { | ||
reflectingInfo?: ReflectingUpdate, | ||
checkReflecting: () => void, | ||
}; | ||
|
||
const PublishPending = (props: Props) => { | ||
const { reflectingInfo = {}, checkReflecting } = props; | ||
const { fileListItem, progress, stalled } = reflectingInfo; | ||
const sdHash = fileListItem && fileListItem.sd_hash; | ||
const reflecting = Object.keys(reflectingInfo).length; | ||
if (stalled) { | ||
return ( | ||
<Button | ||
button="link" | ||
label={__('Upload stalled. Retry?')} | ||
onClick={() => Lbry.file_reflect({ sd_hash: sdHash }).then(() => checkReflecting())} | ||
/> | ||
); | ||
} else if (reflecting) { | ||
return <span>{__('Uploading (%progress%%) ', { progress: progress })}</span>; | ||
} else { | ||
return <span>{__('Confirming')}</span>; | ||
} | ||
}; | ||
|
||
export default PublishPending; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters