text -> message

This commit is contained in:
erik-sn committed 2020-09-25 03:07:28 -04:00
1 parent 3d8bd2b334
commit 0789f69e2f
3 files changed
+28 -22

No files matched your search

+5 -1
View File
@@ -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 = () => {