diff --git a/packages/hoppscotch-app/components/http/Request.vue b/packages/hoppscotch-app/components/http/Request.vue index f13e2e854..7d91014dd 100644 --- a/packages/hoppscotch-app/components/http/Request.vue +++ b/packages/hoppscotch-app/components/http/Request.vue @@ -168,12 +168,11 @@ /> @@ -327,7 +326,12 @@ const clearContent = () => { resetRESTRequest() } +const copyLinkIcon = hasNavigatorShare ? ref("share-2") : ref("copy") +const shareLink = ref("") + const copyRequest = () => { + shareLink.value = new URL(window.location.href).pathname + if (navigator.share) { const time = new Date().toLocaleTimeString() const date = new Date().toLocaleDateString() @@ -340,10 +344,12 @@ const copyRequest = () => { .then(() => {}) .catch(() => {}) } else { + copyLinkIcon.value = "check" copyToClipboard(window.location.href) $toast.success(`${t("state.copied_to_clipboard")}`, { icon: "content_paste", }) + setTimeout(() => (copyLinkIcon.value = "copy"), 1000) } }