mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 21:48:14 +00:00
fix: sortowanie stacji
This commit is contained in:
@@ -102,14 +102,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
sortedStationList() {
|
sortedStationList() {
|
||||||
const sortedList = this.store.stationList.sort((a, b) => (a.name > b.name ? 1 : -1));
|
return this.store.stationList
|
||||||
// if (!this.store.searchedSceneryName || this.store.searchedSceneryName == '') return sortedList;
|
.filter((station) => station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase()))
|
||||||
|
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
||||||
return sortedList.filter(
|
.filter((_, i) => i < this.store.maxVisibleResults);
|
||||||
(station, i) =>
|
|
||||||
i < this.store.maxVisibleResults &&
|
|
||||||
station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase())
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user