From c20386fa54352394b1793a830e3f90674415ea90 Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Fri, 15 Dec 2023 22:41:55 +0500 Subject: [PATCH] Update --- public/assets/js/mastodon.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/public/assets/js/mastodon.js b/public/assets/js/mastodon.js index 5fc1d70..9770010 100644 --- a/public/assets/js/mastodon.js +++ b/public/assets/js/mastodon.js @@ -69,20 +69,19 @@ async function fetchData() { log.innerHTML += `${post_tpl}
`; }); } - async function openInNewTab(url) { window.open(url, '_blank').focus(); } - async function getMastodonPage() { + let log = document.getElementById('log'); + if (!log) { + setTimeout(getMastodonPage, 1000); + return; + } + let tplUrl = 'json/mastodon-tpl.html'; let response = await fetch(tplUrl); var tpl = ""; - let log = document.getElementById('log'); - - if (!log) { - setTimeout(getMastodonPage, 1000); - } log.innerHTML = "";