From 68b0827f66f1f7f18933bbf67c8a68075ca44a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Wed, 18 Aug 2021 13:50:44 +0500 Subject: [PATCH] rename showLoader --- src/pages/Messages.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/Messages.jsx b/src/pages/Messages.jsx index a2f8a65..f9315e5 100644 --- a/src/pages/Messages.jsx +++ b/src/pages/Messages.jsx @@ -60,8 +60,7 @@ export default function Messages({idWell}) { const [range, setRange] = useState([]) const [categories, setCategories] = useState([]) const [searchString, setSearchString] = useState('') - - const [loader, setLoader] = useState(false) + const [showLoader, setShowLoader] = useState(false) const children = filterOptions.map((line) => ) @@ -79,7 +78,7 @@ export default function Messages({idWell}) { useEffect(() => { const GetMessages = async () => { - setLoader(true) + setShowLoader(true) try { let begin = null @@ -97,7 +96,7 @@ export default function Messages({idWell}) { searchString) if (paginatedMessages === null){ notify(`Данных по скважине "${idWell}" нет`, 'warning') - setLoader(false) + setShowLoader(false) return } @@ -118,7 +117,7 @@ export default function Messages({idWell}) { console.log(ex) notify(`Не удалось загрузить сообщения по скважине "${idWell}"`, 'error') } - setLoader(false) + setShowLoader(false) } GetMessages() }, [idWell, page, categories, range, searchString]) @@ -146,7 +145,7 @@ export default function Messages({idWell}) { onSearch={onChangeSearchString} /> - +