fix posting, editing, editor settings hide on edits

This commit is contained in:
feruz 2020-10-15 15:20:51 +03:00
parent 857b5be685
commit c1347c6084
5 changed files with 16 additions and 13 deletions

View File

@ -35,6 +35,7 @@ const BasicHeaderView = ({
isModalHeader,
isPreviewActive,
isReply,
isEdit,
quickTitle,
rightButtonText,
rightIconName,
@ -138,7 +139,7 @@ const BasicHeaderView = ({
onPress={() => (isModalHeader ? handleOnPressClose() : handleOnPressBackButton())}
disabled={disabled}
/>
{isHasIcons && !isReply && (
{isHasIcons && !isReply && !isEdit && (
<IconButton
style={{ marginHorizontal: 20 }}
iconStyle={[styles.backIcon, isModalHeader && styles.closeIcon]}

View File

@ -45,7 +45,7 @@ const PostsContainer = ({
const [promotedPosts, setPromotedPosts] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [refreshing, setRefreshing] = useState(false);
const [posts, setPosts] = useState(feedPosts || []);
const [posts, setPosts] = useState(isConnected ? [] : feedPosts);
const [selectedFilterIndex, setSelectedFilterIndex] = useState(selectedOptionIndex || 0);
const [selectedFilterValue, setSelectedFilterValue] = useState(
filterOptionsValue && filterOptionsValue[selectedFilterIndex],
@ -148,7 +148,7 @@ const PostsContainer = ({
const filter = type || selectedFilterValue;
let options = {};
const limit = 6;
const limit = 4;
let func = null;
if (filter === 'feed' || filter === 'blog' || getFor === 'blog' || filter === 'reblogs') {
@ -196,7 +196,7 @@ const PostsContainer = ({
}
}
if (posts.length < 7 && pageType !== 'profiles') {
if (posts.length < 4 && pageType !== 'profiles') {
_setFeedPosts(_posts);
}

View File

@ -302,7 +302,7 @@
"fail": "Fail!",
"move": "Move",
"move_question": "Are you sure to move to drafts?",
"success_shared": "Content successfully posted, fetching now",
"success_shared": "Success! Content submitted!",
"success_moved": "Moved to draft",
"permission_denied": "Permission denied",
"permission_text": "Please, go to phone Settings and change Ecency app permissions.",

View File

@ -1110,6 +1110,7 @@ export const postContent = (
title,
body,
jsonMetadata,
isEdit = false,
options = null,
voteWeight = null,
) =>
@ -1127,7 +1128,9 @@ export const postContent = (
).then((resp) => {
const t = title ? 100 : 110;
const { block_num, id } = resp;
userActivity(account.username, t, block_num, id);
if (!isEdit) {
userActivity(account.username, t, block_num, id);
}
return resp;
});
@ -1159,7 +1162,7 @@ const _postContent = async (
const params = {
parent_author: parentAuthor,
parent_permlink: parentPermlink,
parent_permlink: parentPermlink || '',
author,
permlink,
title,

View File

@ -371,13 +371,11 @@ class EditorContainer extends Component {
isPostSending: false,
});
navigation.navigate({
routeName: ROUTES.SCREENS.POST,
routeName: ROUTES.SCREENS.PROFILE,
params: {
author: get(currentAccount, 'name'),
permlink,
isNewPost: true,
username: get(currentAccount, 'name'),
},
key: permlink,
key: get(currentAccount, 'name'),
});
}, 3000);
})
@ -435,7 +433,7 @@ class EditorContainer extends Component {
_submitEdit = async (fields) => {
const { currentAccount, pinCode } = this.props;
const { post } = this.state;
const { post, isEdit } = this.state;
if (currentAccount) {
this.setState({
isPostSending: true,
@ -476,6 +474,7 @@ class EditorContainer extends Component {
title,
newBody,
jsonMeta,
isEdit,
)
.then(() => {
AsyncStorage.setItem('temp-reply', '');