Merge pull request #1104 from esteemapp/bugfix/comment-deep-link

Fixed comment deep link issue
This commit is contained in:
uğur erdal 2019-08-28 19:00:26 +03:00 committed by GitHub
commit b36ba8d5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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,10 +216,9 @@ 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;
if (get(result, 'parent_permlink') && get(result, 'parent_author')) {
isHasParentPost = true;
}
})
.catch(() => {
@ -226,7 +226,7 @@ class ApplicationContainer extends Component {
});
routeName = ROUTES.SCREENS.POST;
params = { content };
params = { content, isHasParentPost };
} else if (author) {
profile = await getUser(author);

View File

@ -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) {