From 0be5c10ec2a367ff5b1cc471d454caefc3a51d60 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Wed, 28 Aug 2019 16:07:53 +0300 Subject: [PATCH 1/2] Fixed comment deep link issue --- .../application/container/applicationContainer.js | 10 ++++------ src/screens/post/container/postContainer.js | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 4090008af..0b0c1ccd0 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -181,6 +181,7 @@ class ApplicationContainer extends Component { let params; let content; let profile; + let isHasParentPost = false; const { currentAccount, dispatch } = this.props; const { isIos } = this.state; @@ -215,18 +216,15 @@ class ApplicationContainer extends Component { if (author && permlink) { await getPost(author, permlink, currentAccount.name) .then(result => { - if (get(result, 'title')) { - content = result; - } else { - this._handleAlert('deep_link.no_existing_post'); - } + content = result; + isHasParentPost = get(result, 'parent_permlink'); }) .catch(() => { this._handleAlert('deep_link.no_existing_post'); }); routeName = ROUTES.SCREENS.POST; - params = { content }; + params = { content, isHasParentPost }; } else if (author) { profile = await getUser(author); diff --git a/src/screens/post/container/postContainer.js b/src/screens/post/container/postContainer.js index 2ee5efc9a..87d6bd51d 100644 --- a/src/screens/post/container/postContainer.js +++ b/src/screens/post/container/postContainer.js @@ -43,8 +43,8 @@ class PostContainer extends Component { } else if (author && permlink) { this._loadPost(author, permlink); this.setState({ author }); - if (isHasParentPost) this.setState({ isHasParentPost }); } + if (isHasParentPost) this.setState({ isHasParentPost }); } componentWillReceiveProps(nextProps) { From ccd826142574c6f77cd294595d34fb307860a1b9 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Wed, 28 Aug 2019 17:35:28 +0300 Subject: [PATCH 2/2] Updated deeplink func --- src/screens/application/container/applicationContainer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 0b0c1ccd0..42b7ce70e 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -217,7 +217,9 @@ class ApplicationContainer extends Component { await getPost(author, permlink, currentAccount.name) .then(result => { content = result; - isHasParentPost = get(result, 'parent_permlink'); + if (get(result, 'parent_permlink') && get(result, 'parent_author')) { + isHasParentPost = true; + } }) .catch(() => { this._handleAlert('deep_link.no_existing_post');