From 591cb9b6aebd2ff13a76e6a80db5e04654fcdf33 Mon Sep 17 00:00:00 2001 From: merefield Date: Fri, 17 Nov 2023 11:24:46 +0000 Subject: [PATCH] IMPROVE: utilise button icon to signify update --- .../components/wizard-subscription-badge.hbs | 15 ++++++--------- .../components/wizard-subscription-badge.js | 8 +++----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/assets/javascripts/discourse/components/wizard-subscription-badge.hbs b/assets/javascripts/discourse/components/wizard-subscription-badge.hbs index 30b79cb5..08853169 100644 --- a/assets/javascripts/discourse/components/wizard-subscription-badge.hbs +++ b/assets/javascripts/discourse/components/wizard-subscription-badge.hbs @@ -7,17 +7,14 @@ {{d-icon "pavilion-logo"}} {{this.label}} - - {{#if this.updating}} - {{loading-spinner size="small"}} - {{else if updateIcon}} - {{d-icon updateIcon}} - {{/if}} - \ No newline at end of file +> +{{#if this.updating}} + {{loading-spinner size="small"}} +{{/if}} + \ No newline at end of file diff --git a/assets/javascripts/discourse/components/wizard-subscription-badge.js b/assets/javascripts/discourse/components/wizard-subscription-badge.js index f2115fdb..e103c95b 100644 --- a/assets/javascripts/discourse/components/wizard-subscription-badge.js +++ b/assets/javascripts/discourse/components/wizard-subscription-badge.js @@ -8,7 +8,7 @@ import I18n from "I18n"; export default class WizardSubscriptionBadge extends Component { @service subscription; @tracked updating = false; - @tracked updateIcon = null; + @tracked updateIcon = "sync"; basePath = "/admin/plugins/subscription-client"; @computed("subscription.subscriptionType") @@ -38,12 +38,10 @@ export default class WizardSubscriptionBadge extends Component { @action update() { this.updating = true; - this.updateIcon = "check"; + this.updateIcon = null; this.subscription.updateSubscriptionStatus().finally(() => { + this.updateIcon = "sync"; this.updating = false; - setTimeout(() => { - this.updateIcon = null; - }, 5000); }); } }