Skip to content

Commit

Permalink
Fixed discussion board showing invalid date when posting or replying.…
Browse files Browse the repository at this point in the history
… Also fixed pest filter to filter by identified instead of submitted
  • Loading branch information
AJBuilder committed Apr 27, 2023
1 parent e33d5b0 commit 2de4390
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/ui-components/DBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export function DBoard({props}) {
const [filterFunction, setFilterFunction] = React.useState((Predicates.ALL));
const [displayCount, setDisplayCount] = React.useState(20);



React.useEffect(() => {

function getPosts() {

let newPosts = [];

DataStore.query(Post,
Expand Down Expand Up @@ -61,6 +59,12 @@ export function DBoard({props}) {
setPosts(newPosts);
});

}


React.useEffect(() => {

getPosts();

}, [sortFunction, displayCount]);

Expand All @@ -74,7 +78,7 @@ export function DBoard({props}) {
content: form.content.value,
};
createPost(post.title, post.content, null);
setPosts([...posts, post]);
getPosts();
form.reset();
setIsFormVisible(false);
};
Expand Down
2 changes: 1 addition & 1 deletion src/ui-components/ReportViewCollectionCustom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default function ReportViewCollectionCustom(props) {
(selectedUser === "All" || item.authorID === selectedUser) &&
item.longitude > (userLocation.coords.longitude - longDiff) && item.longitude < (userLocation.coords.longitude + longDiff) &&
item.latitude > (userLocation.coords.latitude - latDiff) && item.latitude < (userLocation.coords.latitude + latDiff) &&
(selectedPest === "All" || item.pestSubmitted === selectedPest) &&
(selectedPest === "All" || item.pestIdentified === selectedPest) &&
(selectedAddress === "" || (item.address_number + item.address_street + item.address_neighborhood + item.address_municipality + item.address_region + item.address_country + item.address_postalCode).includes(selectedAddress))
){
return true;
Expand Down
5 changes: 5 additions & 0 deletions toBeAdded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Only on popup at a time in MapView
Confirm when report deleted
Add delete functionality for moderators (and author?)
Add accuracy circle around each report
Cluster reports that come from the same exact coordinates

0 comments on commit 2de4390

Please sign in to comment.