diff --git a/src/components/profile/ProfileDescription/index.tsx b/src/components/profile/ProfileDescription/index.tsx index f3b43ea1..e083c47a 100644 --- a/src/components/profile/ProfileDescription/index.tsx +++ b/src/components/profile/ProfileDescription/index.tsx @@ -5,6 +5,8 @@ import { connect } from 'react-redux'; import { selectAuthProfile } from '~/redux/auth/selectors'; import { ProfileLoader } from '~/containers/profile/ProfileLoader'; import { Group } from '~/components/containers/Group'; +import markdown from '~/styles/common/markdown.module.scss'; +import classNames from 'classnames'; const mapStateToProps = state => ({ profile: selectAuthProfile(state), @@ -19,7 +21,7 @@ const ProfileDescriptionUnconnected: FC = ({ profile: { user, is_loading
{!!user?.description && ( )} diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 8a629dfe..15cf8909 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -258,9 +258,9 @@ function* onEditSaga({ id }: ReturnType) { } function* onLikeSaga({ id }: ReturnType) { - try { - const { current }: ReturnType = yield select(selectNode); + const { current }: ReturnType = yield select(selectNode); + try { const count = current.like_count || 0; yield call(updateNodeEverywhere, { @@ -274,6 +274,7 @@ function* onLikeSaga({ id }: ReturnType) { yield call(updateNodeEverywhere, { ...current, is_liked: data.is_liked, + like_count: data.is_liked ? count + 1 : Math.max(count - 1, 0), }); } catch {} }