Authored by 盖剑秋

Fix bug on comment delete. reviewed by redding.

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