make sure lbryfirst error makes it up to UI

This commit is contained in:
Sean Yesmunt 2020-07-09 10:58:43 -04:00
parent 8077d2c210
commit 81344b9826
6 changed files with 27 additions and 5 deletions

View file

@ -93,6 +93,7 @@ let isLbryFirstRunning = false;
const startLbryFirst = async () => {
if (isLbryFirstRunning) {
console.log('LbryFirst already running');
handleLbryFirstLaunched();
return;
}

View file

@ -136,7 +136,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#31647e4ee7371ca05a9fa13b3ac3f5b4a794383d",
"lbry-redux": "lbryio/lbry-redux#e6d89b06909b7f3a280e25625669f64ce06f340d",
"lbryinc": "lbryio/lbryinc#cff5dd60934c4c6080e135f47ebbece1548c658c",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -1274,5 +1274,8 @@
"Sign In With YouTube": "Sign In With YouTube",
"There was an error with LBRY first publishing.": "There was an error with LBRY first publishing.",
"Automagically upload to your youtube channel.": "Automagically upload to your youtube channel.",
"Your publish on LBRY was successful, but uploading to YouTube Failed.": "Your publish on LBRY was successful, but uploading to YouTube Failed.",
"Your publish on LBRY was successful, but the YouTube upload failed.": "Your publish on LBRY was successful, but the YouTube upload failed.",
"Your file was published to LBRY, but the YouTube upload failed.": "Your file was published to LBRY, but the YouTube upload failed.",
"--end--": "--end--"
}

View file

@ -4,6 +4,7 @@ import { Modal } from 'modal/modal';
import ClaimPreview from 'component/claimPreview';
import Button from 'component/button';
import Card from 'component/common/card';
import Nag from 'component/common/nag';
type Props = {
closeModal: () => void,
@ -12,11 +13,12 @@ type Props = {
uri: string,
isEdit: boolean,
filePath: ?string,
lbryFirstError: ?string,
};
class ModalPublishSuccess extends React.PureComponent<Props> {
render() {
const { closeModal, clearPublish, navigate, uri, isEdit, filePath } = this.props;
const { closeModal, clearPublish, navigate, uri, isEdit, filePath, lbryFirstError } = this.props;
const contentLabel = isEdit ? __('Update published') : __('File published');
const publishMessage = isEdit
? __('Your update is now pending on LBRY. It will take a few minutes to appear for other users.')
@ -63,6 +65,21 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
<Button button="link" label={__('Close')} onClick={handleClose} />
</div>
}
nag={
lbryFirstError && (
<Nag
relative
type="error"
message={
<span>
{__('Your file was published to LBRY, but the YouTube upload failed.')}
<br />
{lbryFirstError}
</span>
}
/>
)
}
/>
</Modal>
);

View file

@ -18,7 +18,7 @@ import { formatLbryUrlForWeb } from 'util/url';
import { doOpenModal } from './app';
export const doPublishDesktop = (filePath: string) => (dispatch: Dispatch, getState: () => {}) => {
const publishSuccess = successResponse => {
const publishSuccess = (successResponse, lbryFirstError) => {
const state = getState();
const myClaims = selectMyClaims(state);
const pendingClaim = successResponse.outputs[0];
@ -58,6 +58,7 @@ export const doPublishDesktop = (filePath: string) => (dispatch: Dispatch, getSt
uri: url,
isEdit,
filePath,
lbryFirstError,
})
);
dispatch(doCheckPendingPublishesApp());

View file

@ -6383,9 +6383,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#31647e4ee7371ca05a9fa13b3ac3f5b4a794383d:
lbry-redux@lbryio/lbry-redux#e6d89b06909b7f3a280e25625669f64ce06f340d:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/31647e4ee7371ca05a9fa13b3ac3f5b4a794383d"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/e6d89b06909b7f3a280e25625669f64ce06f340d"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"