fix: sortowanie stacji

This commit is contained in:
2023-01-31 17:43:41 +01:00
parent 1f0f22dbe5
commit 446698b832
+4 -8
View File
@@ -102,14 +102,10 @@ export default defineComponent({
computed: {
sortedStationList() {
const sortedList = this.store.stationList.sort((a, b) => (a.name > b.name ? 1 : -1));
// if (!this.store.searchedSceneryName || this.store.searchedSceneryName == '') return sortedList;
return sortedList.filter(
(station, i) =>
i < this.store.maxVisibleResults &&
station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase())
);
return this.store.stationList
.filter((station) => station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase()))
.sort((a, b) => (a.name > b.name ? 1 : -1))
.filter((_, i) => i < this.store.maxVisibleResults);
},
},