Skip to content
Snippets Groups Projects
Commit 51e7f3a5 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Fix bug in places list with globally stored setting

parent fe3940e4
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,7 @@
<div class="row form-group form-switch">
<div class="col-12 form-check">
<input type="checkbox" class="form-check-input" v-model="showOnlyUsersPOIs" @change="handleFiltersChanged"
id="showOnlyUsersPOIs">
<input type="checkbox" class="form-check-input" v-model="showOnlyUsersPOIs" id="showOnlyUsersPOIs" @change="handleFiltersChanged">
<label class="form-check-label" for="showOnlyUsersPOIs">Bare mine steder</label>
</div>
</div>
......@@ -127,8 +126,8 @@ export default {
},
handleFiltersChanged() {
this.listPOI = this.filterListPOI();
localStorage.setItem(CommonUtil.CONST_STORAGE_DISPLAY_ONLY_MY_POIS, this.showOnlyUsersPOIs);
this.listPOI = this.filterListPOI();
},
getPOIListFromStore() {
const userId = this.$root.sharedState.userId;
......@@ -167,11 +166,14 @@ export default {
mounted() {
CommonUtil.setHeaderTitle(this.$i18n.t("placeslist.heading"));
this.poiRequired = this.$route.query.poiRequired;
this.CONST_URL_DOMAIN = CommonUtil.CONST_URL_DOMAIN;
this.poiRequired = this.$route.query.poiRequired;
const globalDisplayOnlyMyPOIs = localStorage.getItem(CommonUtil.CONST_STORAGE_DISPLAY_ONLY_MY_POIS)
this.showOnlyUsersPOIs = globalDisplayOnlyMyPOIs === 'true'
this.getPOIListFromStore();
this.listPOI = this.filterListPOI();
this.showOnlyUsersPOIs = localStorage.getItem(CommonUtil.CONST_STORAGE_DISPLAY_ONLY_MY_POIS)
// Making it globally available, so that e.g. the Sync component can update the list
// calling e.g. this.$root.sharedState.placesListComponent.fooBar();
this.$root.sharedState.placesListComponent = this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment