From 162be52f1d85eb05c448277774f1a33692d48c23 Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Sun, 10 Dec 2023 01:28:59 +0500 Subject: [PATCH] Update --- public/assets/js/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/js/script.js b/public/assets/js/script.js index 32d49e6..16c0636 100644 --- a/public/assets/js/script.js +++ b/public/assets/js/script.js @@ -81,7 +81,7 @@ async function bodyFetch(url) { if (response.ok) { // если HTTP-статус в диапазоне 200-299 // получаем тело ответа (см. про этот метод ниже) let text = await response.text(); - if (tplUrl == 'news.tpl.html') {fetchData();} + if (tplUrl == 'news.tpl.html') {await fetchData();} body.innerHTML = text; } else { body.innerHTML = "Ой всё сломалось :("; @@ -142,7 +142,7 @@ let fetchPage = async function(evt) { try { const response = await fetch(tplUrl, { signal }); text = await response.text(); - if (tplUrl == 'news.tpl.html') {fetchData();} + if (tplUrl == 'news.tpl.html') {await fetchData();} } catch (error) { // DOMException: The user aborted a request. console.log('Error: ', error)