mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 04:41:43 +03:00
fixed editor bugs
This commit is contained in:
parent
dbd667fd65
commit
303b8b81c7
@ -48,6 +48,7 @@ class PostDisplayContainer extends Component {
|
||||
|
||||
_handleOnReplyPress = () => {
|
||||
const { post, navigation } = this.props;
|
||||
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
@ -60,14 +61,20 @@ class PostDisplayContainer extends Component {
|
||||
|
||||
_handleOnEditPress = () => {
|
||||
const { post, navigation } = this.props;
|
||||
|
||||
if (post) {
|
||||
const isReply = post.parent_author;
|
||||
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
isEdit: true,
|
||||
isReply,
|
||||
post,
|
||||
fetchPost: this._fetchPost,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_fetchPost = async () => {
|
||||
|
@ -274,9 +274,9 @@ class EditorContainer extends Component {
|
||||
};
|
||||
|
||||
_saveCurrentDraft = async (fields) => {
|
||||
const { draftId, isReply } = this.state;
|
||||
const { draftId, isReply, isEdit } = this.state;
|
||||
|
||||
if (!draftId) {
|
||||
if (!draftId && !isEdit) {
|
||||
const { currentAccount } = this.props;
|
||||
const username = currentAccount && currentAccount.name ? currentAccount.name : '';
|
||||
|
||||
@ -408,8 +408,8 @@ class EditorContainer extends Component {
|
||||
0,
|
||||
)
|
||||
.then(() => {
|
||||
this._handleSubmitSuccess();
|
||||
AsyncStorage.setItem('temp-reply', '');
|
||||
this._handleSubmitSuccess();
|
||||
})
|
||||
.catch((error) => {
|
||||
this._handleSubmitFailure(error);
|
||||
|
@ -53,11 +53,11 @@ export default EStyleSheet.create({
|
||||
},
|
||||
postTabBar: {
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
flex: 1,
|
||||
},
|
||||
commentsTabBar: {
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 5,
|
||||
},
|
||||
tabBarTitle: {},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user