Browse Source

post: validate post id before updating

fix/edit-post-ws
eiknat 10 months ago
parent
commit
13b6d92c53
  1. 16
      src/components/post.tsx

16
src/components/post.tsx

@ -606,14 +606,18 @@ export class Post extends Component<any, PostState> {
this.setState(this.state);
} else if (isPostChanged(res.op)) {
let data = res.data as PostResponse;
this.state.post = data.post;
this.setState(this.state);
setupTippy();
if (this.state.post.id === data.post.id) {
this.state.post = data.post;
this.setState(this.state);
setupTippy();
}
} else if (res.op == UserOperation.SavePost) {
let data = res.data as PostResponse;
this.state.post = data.post;
this.setState(this.state);
setupTippy();
if (this.state.post.id === data.post.id) {
this.state.post = data.post;
this.setState(this.state);
setupTippy();
}
} else if (res.op == UserOperation.EditCommunity) {
let data = res.data as CommunityResponse;
this.state.community = data.community;

Loading…
Cancel
Save