mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 13:38:13 +00:00
fix: sortowanie stacji
This commit is contained in:
@@ -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);
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user