Phyks (Lucas Verney)
a7792f5dbb
Upvotes now reset the `datetime` field of the report, making it appear as if it was newly reported. They also extend the lifetime for accidents and GCUM. This introduces database migrations as well. Closes https://framagit.org/phyks/cyclassist/issues/41.
19 lines
451 B
JavaScript
19 lines
451 B
JavaScript
import { REPORT_DOWNVOTES_THRESHOLD } from '@/constants';
|
|
|
|
export function getLastLocation(state) {
|
|
const { gpx } = state.location;
|
|
if (gpx.length > 0) {
|
|
return gpx[gpx.length - 1];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
export function notDismissedReports(state) {
|
|
return state.reports.filter((item) => {
|
|
if (item.attributes.downvotes >= REPORT_DOWNVOTES_THRESHOLD) {
|
|
return false;
|
|
}
|
|
return true;
|
|
});
|
|
}
|