feature: local storage

This commit is contained in:
2023-01-31 17:33:56 +01:00
parent 2cb8b1dc15
commit 34759735d1
4 changed files with 39 additions and 3 deletions
+5 -3
View File
@@ -103,10 +103,12 @@ 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;
// if (!this.store.searchedSceneryName || this.store.searchedSceneryName == '') return sortedList;
return sortedList.filter((station) =>
station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase())
return sortedList.filter(
(station, i) =>
i < this.store.maxVisibleResults &&
station.name.toLowerCase().startsWith(this.store.searchedSceneryName.toLowerCase())
);
},
},