Disable submit when loading. Fixes #706
This commit is contained in:
parent
c1dbeb43c9
commit
63fbf70eaa
5 changed files with 19 additions and 5 deletions
2
ui/src/components/comment-form.tsx
vendored
2
ui/src/components/comment-form.tsx
vendored
|
@ -151,7 +151,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
<button
|
||||
type="submit"
|
||||
class="btn btn-sm btn-secondary mr-2"
|
||||
disabled={this.props.disabled}
|
||||
disabled={this.props.disabled || this.state.loading}
|
||||
>
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
|
|
6
ui/src/components/community-form.tsx
vendored
6
ui/src/components/community-form.tsx
vendored
|
@ -207,7 +207,11 @@ export class CommunityForm extends Component<
|
|||
)}
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
4
ui/src/components/post-form.tsx
vendored
4
ui/src/components/post-form.tsx
vendored
|
@ -360,7 +360,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button
|
||||
disabled={!this.state.postForm.community_id}
|
||||
disabled={
|
||||
!this.state.postForm.community_id || this.state.loading
|
||||
}
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
>
|
||||
|
|
6
ui/src/components/private-message-form.tsx
vendored
6
ui/src/components/private-message-form.tsx
vendored
|
@ -183,7 +183,11 @@ export class PrivateMessageForm extends Component<
|
|||
)}
|
||||
<div class="form-group row">
|
||||
<div class="offset-sm-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
6
ui/src/components/site-form.tsx
vendored
6
ui/src/components/site-form.tsx
vendored
|
@ -175,7 +175,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
|||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-secondary mr-2">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-secondary mr-2"
|
||||
disabled={this.state.loading}
|
||||
>
|
||||
{this.state.loading ? (
|
||||
<svg class="icon icon-spinner spin">
|
||||
<use xlinkHref="#icon-spinner"></use>
|
||||
|
|
Loading…
Reference in a new issue