fix: crash on share modal

This happens randomly or when the claim is not confirmed but accessed via wallet page.
Added note to use cmd/ctrl-R to refresh in cases the button doesn't work.
This commit is contained in:
Thomas Zarebczan 2019-09-20 10:54:43 -04:00 committed by Sean Yesmunt
parent 2f318cbf5e
commit 8bdf2b0461
2 changed files with 3 additions and 3 deletions

View file

@ -83,7 +83,7 @@ class ErrorBoundary extends React.Component<Props, State> {
label={__('refreshing the app')}
onClick={this.refresh}
/>{' '}
{__('to fix it')}.
{__("to fix it. If that doesn't work, press CMD/CTRL-R to reset to the homepage.")}.
</p>
</Fragment>
}

View file

@ -26,11 +26,11 @@ class SocialShare extends React.PureComponent<Props> {
render() {
const { claim } = this.props;
const { canonical_url: canonicalUrl } = claim;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl } = claim;
const { speechShareable, onDone } = this.props;
const lbryTvPrefix = 'https://beta.lbry.tv/';
const lbryPrefix = 'https://open.lbry.com/';
const lbryUri = canonicalUrl.split('lbry://')[1];
const lbryUri = canonicalUrl ? canonicalUrl.split('lbry://')[1] : permanentUrl.split('lbry://')[1];
const lbryWebUrl = lbryUri.replace(/#/g, ':');
const encodedLbryURL: string = `${lbryPrefix}${encodeURIComponent(lbryWebUrl)}`;
const lbryURL: string = `${lbryPrefix}${lbryWebUrl}`;