fix: only update image if textbox populated

This commit is contained in:
Marcus Noble 2021-07-24 06:03:59 +01:00
parent 651f3683d2
commit f188873c40

View File

@ -106,9 +106,11 @@
} }
document.getElementById('tweetURL').addEventListener('change', function(e) { document.getElementById('tweetURL').addEventListener('change', function(e) {
if (e.target.value.trim() != "") {
let parts = e.target.value.split("/"); let parts = e.target.value.split("/");
let tweetID = parts[parts.length-1]; let tweetID = parts[parts.length-1];
loadTweet(tweetID); loadTweet(tweetID);
}
}); });
document.getElementById('imageTagExample').addEventListener('click', function(e) { document.getElementById('imageTagExample').addEventListener('click', function(e) {