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