mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-11 22:16:55 +00:00
better default filters
This commit is contained in:
@@ -70,9 +70,13 @@ export default defineComponent(
|
||||
},
|
||||
filterNodes(nodes: Node[] = []) {
|
||||
let filters: Filters | null = null;
|
||||
const filtersString = window.localStorage.getItem("filters");
|
||||
let filtersString = window.localStorage.getItem("filters");
|
||||
if (filtersString === null) {
|
||||
this.displayNodes = this.nodes;
|
||||
window.localStorage.setItem("filters", JSON.stringify(new Filters()));
|
||||
filtersString = window.localStorage.getItem("filters");
|
||||
}
|
||||
if (filtersString === null) {
|
||||
console.error("Failed to get filters from local storage!");
|
||||
return;
|
||||
}
|
||||
const parsedFilters = JSON.parse(filtersString);
|
||||
@@ -98,7 +102,6 @@ export default defineComponent(
|
||||
},
|
||||
mounted() {
|
||||
this.filterNodes(this.nodes);
|
||||
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
+2
-2
@@ -13,9 +13,9 @@ export default class Filters {
|
||||
jobs?: string[],
|
||||
},
|
||||
) {
|
||||
this.minLevel = data?.minLevel || 1;
|
||||
this.minLevel = data?.minLevel || 91;
|
||||
this.maxLevel = data?.maxLevel || 100;
|
||||
const jobData = data?.jobs || [];
|
||||
const jobData = data?.jobs || [Job.BOTANIST, Job.MINER];
|
||||
|
||||
for (const job of jobData) {
|
||||
const parsedJob = jobFromString(job);
|
||||
|
||||
Reference in New Issue
Block a user