mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-04 20:15:51 +03:00
Merge pull request #1104 from esteemapp/bugfix/comment-deep-link
Fixed comment deep link issue
This commit is contained in:
commit
b36ba8d5d7
@ -181,6 +181,7 @@ class ApplicationContainer extends Component {
|
|||||||
let params;
|
let params;
|
||||||
let content;
|
let content;
|
||||||
let profile;
|
let profile;
|
||||||
|
let isHasParentPost = false;
|
||||||
const { currentAccount, dispatch } = this.props;
|
const { currentAccount, dispatch } = this.props;
|
||||||
const { isIos } = this.state;
|
const { isIos } = this.state;
|
||||||
|
|
||||||
@ -215,10 +216,9 @@ class ApplicationContainer extends Component {
|
|||||||
if (author && permlink) {
|
if (author && permlink) {
|
||||||
await getPost(author, permlink, currentAccount.name)
|
await getPost(author, permlink, currentAccount.name)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (get(result, 'title')) {
|
|
||||||
content = result;
|
content = result;
|
||||||
} else {
|
if (get(result, 'parent_permlink') && get(result, 'parent_author')) {
|
||||||
this._handleAlert('deep_link.no_existing_post');
|
isHasParentPost = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -226,7 +226,7 @@ class ApplicationContainer extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
routeName = ROUTES.SCREENS.POST;
|
routeName = ROUTES.SCREENS.POST;
|
||||||
params = { content };
|
params = { content, isHasParentPost };
|
||||||
} else if (author) {
|
} else if (author) {
|
||||||
profile = await getUser(author);
|
profile = await getUser(author);
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ class PostContainer extends Component {
|
|||||||
} else if (author && permlink) {
|
} else if (author && permlink) {
|
||||||
this._loadPost(author, permlink);
|
this._loadPost(author, permlink);
|
||||||
this.setState({ author });
|
this.setState({ author });
|
||||||
if (isHasParentPost) this.setState({ isHasParentPost });
|
|
||||||
}
|
}
|
||||||
|
if (isHasParentPost) this.setState({ isHasParentPost });
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
Loading…
Reference in New Issue
Block a user