From 8bdf2b0461c9a414ae4b5bacf935f97238b7249a Mon Sep 17 00:00:00 2001
From: Thomas Zarebczan
Date: Fri, 20 Sep 2019 10:54:43 -0400
Subject: [PATCH] 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.
---
src/ui/component/errorBoundary/view.jsx | 2 +-
src/ui/component/socialShare/view.jsx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ui/component/errorBoundary/view.jsx b/src/ui/component/errorBoundary/view.jsx
index 190d51774..ef73ff085 100644
--- a/src/ui/component/errorBoundary/view.jsx
+++ b/src/ui/component/errorBoundary/view.jsx
@@ -83,7 +83,7 @@ class ErrorBoundary extends React.Component {
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.")}.
}
diff --git a/src/ui/component/socialShare/view.jsx b/src/ui/component/socialShare/view.jsx
index 06859f4e8..3a194d222 100644
--- a/src/ui/component/socialShare/view.jsx
+++ b/src/ui/component/socialShare/view.jsx
@@ -26,11 +26,11 @@ class SocialShare extends React.PureComponent {
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}`;