Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanGrims committed Sep 14, 2024
1 parent 1e9f154 commit 20a425b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
41 changes: 23 additions & 18 deletions src/admin/DrawerList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/admin/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 20a425b

Please sign in to comment.