mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
added spinner for comments
This commit is contained in:
parent
3cf2af8f12
commit
223c2f9ba0
@ -28,6 +28,7 @@ export class Comments extends Component {
|
||||
}
|
||||
|
||||
postComment() {
|
||||
this.props.setSpinner(true);
|
||||
let comment = {
|
||||
"new-comment": {
|
||||
who: this.props.ship,
|
||||
@ -43,14 +44,16 @@ export class Comments extends Component {
|
||||
blogId: this.props.blogId,
|
||||
postId: this.props.postId,
|
||||
}
|
||||
}, () => {
|
||||
this.props.api.action("write", "write-action", comment)
|
||||
});
|
||||
|
||||
this.props.api.action("write", "write-action", comment);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (this.state.awaiting) {
|
||||
if (prevProps.comments != this.props.comments) {
|
||||
this.props.setSpinner(false);
|
||||
this.setState({awaiting: false, commentBody: ''});
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ export class Post extends Component {
|
||||
}
|
||||
|
||||
savePost() {
|
||||
this.props.setSpinner(true);
|
||||
if (this.state.title == this.state.titleOriginal &&
|
||||
this.state.body == this.state.bodyOriginal) {
|
||||
return;
|
||||
@ -100,11 +101,9 @@ export class Post extends Component {
|
||||
blogId: this.props.blogId,
|
||||
postId: this.props.postId,
|
||||
}
|
||||
}, () => {
|
||||
this.props.api.action("write", "write-action", data)
|
||||
});
|
||||
|
||||
this.props.setSpinner(true);
|
||||
|
||||
this.props.api.action("write", "write-action", data);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
@ -346,6 +345,7 @@ export class Post extends Component {
|
||||
ship={this.props.ship}
|
||||
blogId={this.props.blogId}
|
||||
postId={this.props.postId}
|
||||
setSpinner={this.props.setSpinner}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -400,6 +400,7 @@ export class Post extends Component {
|
||||
ship={this.props.ship}
|
||||
blogId={this.props.blogId}
|
||||
postId={this.props.postId}
|
||||
setSpinner={this.props.setSpinner}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user