From 20a425b974533b882489c156770e03b4a78a40dc Mon Sep 17 00:00:00 2001 From: JohanGrims Date: Sun, 15 Sep 2024 01:50:09 +0200 Subject: [PATCH] minor fix --- src/admin/DrawerList.jsx | 41 ++++++++++++++++++++++------------------ src/admin/Login.tsx | 2 +- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/admin/DrawerList.jsx b/src/admin/DrawerList.jsx index 7fc5eb5..6d185c2 100644 --- a/src/admin/DrawerList.jsx +++ b/src/admin/DrawerList.jsx @@ -13,25 +13,30 @@ export default function DrawerList() { const navigate = useNavigate(); React.useEffect(() => { - getDocs(collection(db, "/votes")).then((data) => { - data.docs.map((e) => { - let data = e.data(); - console.log(data.version > 1); - if (data.active) { - setActiveVotes((activeVotes) => [ - ...activeVotes, - { id: e.id, title: data.title, version: data.version }, - ]); - } else { - setExpiredVotes((expiredVotes) => [ - ...expiredVotes, - { id: e.id, title: data.title, version: data.version }, - ]); - } - }); + getDocs(collection(db, "/votes")) + .then((data) => { + data.docs.map((e) => { + let data = e.data(); + console.log(data.version > 1); + if (data.active) { + setActiveVotes((activeVotes) => [ + ...activeVotes, + { id: e.id, title: data.title, version: data.version }, + ]); + } else { + setExpiredVotes((expiredVotes) => [ + ...expiredVotes, + { id: e.id, title: data.title, version: data.version }, + ]); + } + }); - setLoading(false); - }); + setLoading(false); + }) + .catch((e) => { + console.error(e); + setLoading(false); + }); }, []); if (loading) { diff --git a/src/admin/Login.tsx b/src/admin/Login.tsx index d54af23..3d427df 100644 --- a/src/admin/Login.tsx +++ b/src/admin/Login.tsx @@ -37,7 +37,7 @@ export default function Login() { .then(() => { alert({ headline: "Email gesendet", - description: "Bitte überprüfe deinen Posteingang.", + description: "Bitte überprüfen Sie Ihren Posteingang.", }); }) .catch((error) => {