Authored by 盖剑秋

Fix bug on comment delete. reviewed by redding.

... ... @@ -467,10 +467,10 @@ export default class SubjectPost extends Component {
}
renderDeleteCommentButton(commentUserId,id) {
if (this.props.dataBlob.header.LZ||(commentUserId == this.props.cidFrom)) {
if (this.props.dataBlob.header[0].LZ||(commentUserId == this.props.cidFrom)) {
return(
<TouchableOpacity
style={{width:20,height:20}}
style={{width:80,height:30,alignItems:'flex-end'}}
onPress={()=>{
this.props.onPressDeleteComment&&this.props.onPressDeleteComment(id);
}}
... ...
... ... @@ -117,7 +117,7 @@ export default function postingReducer(state = initialState, action) {
.set('isIndexTop',isIndexTop)
.set('postsTitle',postsTitle)
.set('praise',praise)
.set('praiseUsers',Immutable.fromJS(praiseUsers))
.set('praiseUsers',Immutable.fromJS(praiseUsers.reverse()))
.set('publishTimeString',publishTimeString)
.set('shareProductSkn',shareProductSkn)
.set('LZ',LZ)
... ... @@ -240,7 +240,7 @@ export default function postingReducer(state = initialState, action) {
let {sid,json} = action.payload;
let item = state.items.get(sid);
let users = item.praiseUsers.toJS();
let newUsers = [{headIcon:json},...users];
let newUsers = [...users,{headIcon:json}];
item = item.set('hasPraise','Y').set('praiseUsers',Immutable.fromJS(newUsers));
let nextState = state.setIn(['items', sid], item);
return nextState;
... ...