2
0

🐛 (whatsapp) Fix WA preview not starting and accept audio and documents messages

This commit is contained in:
Baptiste Arnaud
2023-12-20 10:35:34 +01:00
parent a6536461e5
commit 780b4dee18
28 changed files with 619 additions and 192 deletions

View File

@@ -1,4 +1,8 @@
const urlRegex =
/^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$/
export const validateUrl = (url: string) => urlRegex.test(url)
export const validateUrl = (url: string) => {
try {
new URL(url)
return true
} catch (_) {
return false
}
}