You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError(`Failed to fetch: ${response.status}${response.statusText}`)
46
+
}
47
+
promptText.value=awaitresponse.text()
48
+
} catch (e) {
49
+
console.error('Failed to fetch prompt:', e)
50
+
error.value='Error: Could not load prompt. Please copy it directly from the <a href="https://github.com/MarketSquare/rf-prompt-forge" target="_blank" rel="noopener">source repository</a>.'
51
+
} finally {
52
+
isLoading.value=false
53
+
}
54
+
}
55
+
56
+
constcopyAndTrack= () => {
57
+
if (isLoading.value||error.value) {
58
+
alert('Prompt content is not available for copying.')
59
+
return
60
+
}
61
+
62
+
navigator.clipboard.writeText(promptText.value)
63
+
.then(() => {
64
+
isCopied.value=true
65
+
copyStatusMessage.value='Copied to clipboard!'
66
+
67
+
// Fire Plausible event if plausible is available on the window
68
+
if (window.plausible&&props.plausibleEvent) {
69
+
window.plausible(props.plausibleEvent)
70
+
}
71
+
72
+
setTimeout(() => {
73
+
isCopied.value=false
74
+
copyStatusMessage.value=''
75
+
}, 2000)
76
+
})
77
+
.catch(err=> {
78
+
console.error('Failed to copy text:', err)
79
+
alert('Automatic copy failed. Please select and copy the text manually.')
0 commit comments