fix: validate empty endpoints before sending request - resolved #1968

This commit is contained in:
liyasthomas
2021-11-23 20:01:45 +05:30
parent fdf12a24ed
commit afa750e409
31 changed files with 36 additions and 3 deletions

View File

@@ -288,6 +288,11 @@ watch(loading, () => {
})
const newSendRequest = async () => {
if (newEndpoint.value === "" || /^\s+$/.test(newEndpoint.value)) {
toast.error(`${t("empty.endpoint")}`)
return
}
loading.value = true
// Double calling is because the function returns a TaskEither than should be executed
@@ -387,9 +392,7 @@ const copyShareLink = (shareLink: string) => {
} else {
copyLinkIcon.value = "check"
copyToClipboard(`https://hopp.sh/r${shareLink}`)
toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste",
})
toast.success(`${t("state.copied_to_clipboard")}`)
setTimeout(() => (copyLinkIcon.value = "copy"), 2000)
}
}