mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
text -> message
This commit is contained in:
1 parent
3d8bd2b334
commit
0789f69e2f
3 files changed
+28
-22
No files matched your search
@@ -5,8 +5,12 @@
|
||||
// here we'll use to join and split these strings
|
||||
export const IMAGE_DELIMITER = "||!||";
|
||||
|
||||
/**
|
||||
* Validate that the URL successfully loads in the browser
|
||||
* @param {string} link - a URL we are trying to validate
|
||||
* @param {func} onSuccess - callback if the link is valid
|
||||
*/
|
||||
export function withValidImage(link, onSuccess) {
|
||||
// only add the media if it's a valid URL
|
||||
const image = new Image();
|
||||
image.onload = onSuccess;
|
||||
image.onerror = () => {
|
||||
|
||||
Reference in new issue
Block a user