Merge pull request #349 from esteemapp/bugfix/#337

fixed and closed #337
This commit is contained in:
Feruz M 2019-01-05 19:37:54 +02:00 committed by GitHub
commit bc7867b731
5 changed files with 16 additions and 8 deletions

View File

@ -1,10 +1,10 @@
import 'core-js';
import { AppRegistry } from 'react-native';
import codePush from 'react-native-code-push';
import { name as appName } from './app.json';
import 'core-js';
import 'intl';
import codePush from "react-native-code-push";
//set check frequency options
// set check frequency options
const codePushOptions = { checkFrequency: codePush.CheckFrequency.ON_APP_START };
const eSteemApp = codePush(codePushOptions)(require('./App').default);

View File

@ -76,7 +76,7 @@ class PostCard extends Component {
reblogedBy={reblogedBy}
/>
<View style={styles.dropdownWrapper}>
<PostDropdown content={content} />
<PostDropdown content={content} fetchPost={fetchPost} />
</View>
</View>
<View style={styles.postBodyWrapper}>

View File

@ -74,13 +74,17 @@ class PostDropdownContainer extends PureComponent {
};
_replyNavigation = () => {
const { navigation, content, isLoggedIn } = this.props;
const {
navigation, content, isLoggedIn, fetchPost,
} = this.props;
if (isLoggedIn) {
navigation.navigate({
routeName: ROUTES.SCREENS.EDITOR,
params: {
isReply: true,
post: content,
fetchPost,
},
});
}

View File

@ -52,10 +52,14 @@ class PostContainer extends Component {
// Component Functions
_loadPost = async (author, permlink) => {
_loadPost = async (author = null, permlink = null) => {
const { currentAccount, isLoggedIn } = this.props;
const { post } = this.state;
await getPost(author, permlink, isLoggedIn && currentAccount.username)
const _author = author || post.author;
const _permlink = permlink || post.permlink;
await getPost(_author, _permlink, isLoggedIn && currentAccount.username)
.then((result) => {
if (result) {
this.setState({ post: result });

View File

@ -33,7 +33,7 @@ class PostScreen extends PureComponent {
isHasDropdown
title="Post"
content={post}
dropdownComponent={<PostDropdown content={post} />}
dropdownComponent={<PostDropdown content={post} fetchPost={fetchPost} />}
isNewPost={isNewPost}
/>
<PostDisplay