From f602a1e2d3a169cc2de09f10c4aa2ecbc1edc8d8 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Fri, 19 Nov 2021 09:15:31 +0530 Subject: [PATCH] feat: loading indicator to fetch short code --- packages/hoppscotch-app/components/http/Request.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-app/components/http/Request.vue b/packages/hoppscotch-app/components/http/Request.vue index 7d91014dd..4edc714d3 100644 --- a/packages/hoppscotch-app/components/http/Request.vue +++ b/packages/hoppscotch-app/components/http/Request.vue @@ -170,6 +170,7 @@ ref="copyRequest" :label="shareLink ? shareLink : `${$t('request.copy_link')}`" :svg="copyLinkIcon" + :loading="fetchingShareLink" @click.native=" () => { copyRequest() @@ -328,8 +329,11 @@ const clearContent = () => { const copyLinkIcon = hasNavigatorShare ? ref("share-2") : ref("copy") const shareLink = ref("") +const fetchingShareLink = ref(false) const copyRequest = () => { + fetchingShareLink.value = true + setTimeout(() => (fetchingShareLink.value = false), 1000) shareLink.value = new URL(window.location.href).pathname if (navigator.share) { @@ -349,7 +353,7 @@ const copyRequest = () => { $toast.success(`${t("state.copied_to_clipboard")}`, { icon: "content_paste", }) - setTimeout(() => (copyLinkIcon.value = "copy"), 1000) + setTimeout(() => (copyLinkIcon.value = "copy"), 2000) } }