From 6653ccc011dec86e5140a5d09ea3b2357eab6714 Mon Sep 17 00:00:00 2001
From: GitLab Bot <gitlab-bot@gitlab.com>
Date: Fri, 12 Mar 2021 16:26:10 +0000
Subject: Add latest changes from gitlab-org/gitlab@13-10-stable-ee

---
 .../javascripts/profile/account/components/update_username.vue    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'app/assets/javascripts/profile/account/components/update_username.vue')

diff --git a/app/assets/javascripts/profile/account/components/update_username.vue b/app/assets/javascripts/profile/account/components/update_username.vue
index c5478aa0226..f18c4d8f03e 100644
--- a/app/assets/javascripts/profile/account/components/update_username.vue
+++ b/app/assets/javascripts/profile/account/components/update_username.vue
@@ -90,7 +90,10 @@ Please update your Git repository remotes as soon as possible.`),
           this.isRequestPending = false;
         })
         .catch((error) => {
-          Flash(error.response.data.message);
+          Flash(
+            error?.response?.data?.message ||
+              s__('Profiles|An error occurred while updating your username, please try again.'),
+          );
           this.isRequestPending = false;
           throw error;
         });
@@ -121,7 +124,8 @@ Please update your Git repository remotes as soon as possible.`),
     </div>
     <gl-button
       v-gl-modal-directive="$options.modalId"
-      :disabled="isRequestPending || newUsername === username"
+      :disabled="newUsername === username"
+      :loading="isRequestPending"
       category="primary"
       variant="warning"
       data-testid="username-change-confirmation-modal"
-- 
cgit v1.2.3

