[Resolved] Clicking on vote notification text goes to empty screen. (#75)

This commit is contained in:
Qolzam
2018-07-16 08:54:55 +07:00
parent 6df2051650
commit d1162440bf
3 changed files with 4 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { getTranslate, getActiveLanguage } from 'react-localize-redux'
import { Map } from 'immutable'
import { Map, List as ImuList } from 'immutable'
import { Card, CardActions, CardHeader, CardMedia, CardContent } from '@material-ui/core'
import ListItemText from '@material-ui/core/ListItemText'
@@ -254,7 +254,7 @@ export class PostWriteComponent extends Component<IPostWriteComponentProps, IPos
}
} else { // In edit status we pass post to update functions
const updatedPost = postModel!.set('body', postText)
.set('tags', tags)
.set('tags', ImuList(tags))
.set('image', image)
.set('imageFullPath', imageFullPath)
.set('disableComments', disableComments)

View File

@@ -189,9 +189,6 @@ export class ShareDialogComponent extends Component<IShareDialogComponentProps,
/**
* Map dispatch to props
* @param {func} dispatch is the function to dispatch action to reducers
* @param {object} ownProps is the props belong to component
* @return {object} props of component
*/
const mapDispatchToProps = (dispatch: any, ownProps: IShareDialogComponentProps) => {
return {
@@ -201,9 +198,6 @@ const mapDispatchToProps = (dispatch: any, ownProps: IShareDialogComponentProps)
/**
* Map state to props
* @param {object} state is the obeject from redux store
* @param {object} ownProps is the props belong to component
* @return {object} props of component
*/
const mapStateToProps = (state: any, ownProps: IShareDialogComponentProps) => {
return {

View File

@@ -2,7 +2,7 @@
import moment from 'moment/moment'
import _ from 'lodash'
import { Reducer, Action } from 'redux'
import { Map } from 'immutable'
import { Map, fromJS } from 'immutable'
// - Import action types
import { PostActionType } from 'constants/postActionType'
@@ -53,7 +53,7 @@ export let postReducer = (state = Map(new PostState()), action: IPostAction) =>
case PostActionType.ADD_POST:
return state
.setIn(['userPosts', payload.uid, payload.post.id], Map(payload.post))
.setIn(['userPosts', payload.uid, payload.post.id], fromJS({...payload.post}))
case PostActionType.UPDATE_POST: return updatePost(state, payload)
case PostActionType.UPDATE_POST_COMMENTS: return updatePostComments(state, payload)