feat: implement paste handling and value sync on new env input

This commit is contained in:
Andrew Bastin
2022-02-07 04:08:19 +05:30
committed by liyasthomas
parent 3e0aad5312
commit 10473b2374
2 changed files with 54 additions and 13 deletions

View File

@@ -357,20 +357,15 @@ const ensureMethodInEndpoint = () => {
}
}
const onPasteUrl = (e: { event: ClipboardEvent; previousValue: string }) => {
const onPasteUrl = (e: { pastedValue: string; prevValue: string }) => {
if (!e) return
const clipboardData = e.event.clipboardData
const pastedData = clipboardData?.getData("Text")
if (!pastedData) return
const pastedData = e.pastedValue
if (isCURL(pastedData)) {
e.event.preventDefault()
showCurlImportModal.value = true
curlText.value = pastedData
newEndpoint.value = e.previousValue
newEndpoint.value = e.prevValue
}
}