mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
updated cache data to match with comment response data
This commit is contained in:
parent
4b8fa871b4
commit
0143fa122f
@ -3,7 +3,7 @@ import ActionSheet from 'react-native-actions-sheet';
|
|||||||
import EStyleSheet from 'react-native-extended-stylesheet';
|
import EStyleSheet from 'react-native-extended-stylesheet';
|
||||||
import styles from './quickReplyModalStyles';
|
import styles from './quickReplyModalStyles';
|
||||||
import { forwardRef } from 'react';
|
import { forwardRef } from 'react';
|
||||||
import { View, Text, Alert, TouchableOpacity, Keyboard } from 'react-native';
|
import { View, Text, Alert, TouchableOpacity, Keyboard, Platform } from 'react-native';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { IconButton, MainButton, SummaryArea, TextButton, TextInput, UserAvatar } from '..';
|
import { IconButton, MainButton, SummaryArea, TextButton, TextInput, UserAvatar } from '..';
|
||||||
import { useSelector, useDispatch } from 'react-redux';
|
import { useSelector, useDispatch } from 'react-redux';
|
||||||
@ -16,6 +16,7 @@ import { default as ROUTES } from '../../constants/routeNames';
|
|||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import { navigate } from '../../navigation/service';
|
import { navigate } from '../../navigation/service';
|
||||||
import { Portal } from 'react-native-portalize';
|
import { Portal } from 'react-native-portalize';
|
||||||
|
import { markdown2Html } from '@ecency/render-helper/lib/markdown-2-html';
|
||||||
|
|
||||||
export interface QuickReplyModalProps {}
|
export interface QuickReplyModalProps {}
|
||||||
|
|
||||||
@ -135,18 +136,18 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
//add comment cache entry
|
//add comment cache entry
|
||||||
const createdAt = new Date().getTime();
|
const createdAt = new Date();
|
||||||
dispatch(
|
dispatch(
|
||||||
updateCommentCache(
|
updateCommentCache(
|
||||||
`${currentAccount.name}/${permlink}`,
|
`${currentAccount.name}/${permlink}`,
|
||||||
{
|
{
|
||||||
author:currentAccount.name,
|
author:currentAccount.name,
|
||||||
permlink,
|
permlink,
|
||||||
parentAuthor,
|
parent_author:parentAuthor,
|
||||||
parentPermlink,
|
parent_permlink:parentPermlink,
|
||||||
content: commentValue,
|
body: markdown2Html(commentValue, true, Platform.OS === 'android'),
|
||||||
createdAt: createdAt,
|
created: createdAt.toString(),
|
||||||
expiresAt: createdAt + 600000
|
expiresAt: createdAt.getTime() + 600000
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -11,10 +11,10 @@ export interface Vote {
|
|||||||
export interface Comment {
|
export interface Comment {
|
||||||
author:string,
|
author:string,
|
||||||
permlink:string,
|
permlink:string,
|
||||||
parentAuthor:string,
|
parent_author:string,
|
||||||
parentPermlink:string,
|
parent_permlink:string,
|
||||||
content:string,
|
body:string,
|
||||||
createdAt:number,
|
created:string,
|
||||||
expiresAt:number,
|
expiresAt:number,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user