From aebe11d66c5754ff84892bce5af10675afdeab22 Mon Sep 17 00:00:00 2001 From: MisterGetman <99386291+MisterGetman@users.noreply.github.com> Date: Sun, 30 Jun 2024 05:33:16 +0300 Subject: [PATCH] Done. --- src/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 586f31e..6af7060 100644 --- a/src/main.js +++ b/src/main.js @@ -36,7 +36,7 @@ function queryParams(keyWord) { return params.toString(); } -function handleFormSubmit(e) { +async function handleFormSubmit(e) { e.preventDefault(); loader.classList.toggle('hidden'); page = 1; @@ -44,16 +44,16 @@ function handleFormSubmit(e) { form.keyWord.value = ''; gallery.innerHTML = ''; - loadAndRenderPics(); + await loadAndRenderPics(); loader.classList.toggle('hidden'); } -function handleLoadButtonClick(e) { +async function handleLoadButtonClick(e) { loader.classList.toggle('hidden'); page++; - loadAndRenderMorePics(); + await loadAndRenderMorePics(); loader.classList.toggle('hidden'); }