]> Untitled Git - lemmy.git/commitdiff
Disable submit when loading. Fixes #706
authorDessalines <tyhou13@gmx.com>
Mon, 22 Jun 2020 23:05:55 +0000 (19:05 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 22 Jun 2020 23:05:55 +0000 (19:05 -0400)
ui/src/components/comment-form.tsx
ui/src/components/community-form.tsx
ui/src/components/post-form.tsx
ui/src/components/private-message-form.tsx
ui/src/components/site-form.tsx

index 591bbf1b21c95c9b8136f93d03243c51e5f81412..24bfb7cbb775caa6cc9a5e14dfa44ff44fe7a1cd 100644 (file)
@@ -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">
index eedc2003808533a8af6727a8795a2fa3ff6b0226..90e127383aee6c59deaaef1985db1413d7a5fa3c 100644 (file)
@@ -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>
index 6840c2d48ba7504d2497986586677512d46a49e5..ee805a7c04027d3b909ca50a06fcbb5ad1e153d3 100644 (file)
@@ -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"
               >
index 6ad7de779a598d3ca64e1546779ffca265f2974f..496f3ae5755b491b90e99c244ee3db70fc57f09b 100644 (file)
@@ -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>
index 43d24365d6f5c4c4780b38d218ff26769a078c37..a51286c81cd54972fda3a0bd12b156ad0060a020 100644 (file)
@@ -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>