mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 10:22:38 +03:00
preview icon on/off, fix autosave draft issue
This commit is contained in:
parent
bf68f5dbc3
commit
21e21adeb4
@ -197,8 +197,8 @@ class BasicHeaderView extends Component {
|
||||
size={25}
|
||||
onPress={() => handleOnPressPreviewButton()}
|
||||
iconStyle={styles.rightIcon}
|
||||
iconType="MaterialIcons"
|
||||
name={isPreviewActive ? 'remove-red-eye' : 'remove-red-eye'}
|
||||
iconType="MaterialCommunityIcons"
|
||||
name={isPreviewActive ? 'eye-off' : 'eye'}
|
||||
/>
|
||||
{!isLoading ? (
|
||||
<TextButton
|
||||
|
@ -118,9 +118,10 @@ export const setDraftPost = async (fields, username) => {
|
||||
body: fields.body,
|
||||
};
|
||||
|
||||
if (draft.some(e => e.username === username)) {
|
||||
if (draft && draft.some(e => e.username === username)) {
|
||||
draft = draft.map(item => (item.username === username ? { ...item, ...data } : item));
|
||||
} else {
|
||||
draft = [];
|
||||
draft.push(data);
|
||||
}
|
||||
await setItemToStorage(DRAFT_SCHEMA, draft);
|
||||
|
Loading…
Reference in New Issue
Block a user