2018-09-12 13:51:53 +02:00
|
|
|
import { REPORT_DOWNVOTES_THRESHOLD } from '@/constants';
|
2018-07-05 22:40:24 +02:00
|
|
|
|
2018-08-02 16:58:08 +02:00
|
|
|
export function getLastLocation(state) {
|
2018-08-05 15:47:28 +02:00
|
|
|
const { gpx } = state.location;
|
2018-08-02 16:58:08 +02:00
|
|
|
if (gpx.length > 0) {
|
|
|
|
return gpx[gpx.length - 1];
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-07-05 22:40:24 +02:00
|
|
|
export function notDismissedReports(state) {
|
|
|
|
return state.reports.filter((item) => {
|
2018-09-12 13:51:53 +02:00
|
|
|
if (item.attributes.downvotes >= REPORT_DOWNVOTES_THRESHOLD) {
|
|
|
|
return false;
|
2018-07-05 22:40:24 +02:00
|
|
|
}
|
2018-09-12 13:51:53 +02:00
|
|
|
return true;
|
2018-07-05 22:40:24 +02:00
|
|
|
});
|
|
|
|
}
|