From 398b2624c83f65cb627546fce91508f623a51c22 Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Thu, 23 Jun 2022 15:04:19 +0300 Subject: [PATCH] Add note saving indicator --- src/components/user_profile/user_profile.js | 10 ++++-- src/components/user_profile/user_profile.vue | 36 ++++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 3390e732..b4c604f8 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -42,7 +42,8 @@ const UserProfile = { userId: null, tab: defaultTabKey, footerRef: null, - note: null + note: null, + noteLoading: false } }, created () { @@ -152,8 +153,13 @@ const UserProfile = { window.open(target.href, '_blank') } }, - setNote: debounce(function () { + setNote () { + this.noteLoading = true + this.debounceSetNote() + }, + debounceSetNote: debounce(function () { this.$store.dispatch('setNote', { id: this.userId, note: this.note }) + this.noteLoading = false }, 1500) }, watch: { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 602c002c..5a47cdde 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -40,12 +40,24 @@ -