Persist show archived state

This commit is contained in:
kolaente 2021-01-30 20:59:42 +01:00
parent 826d90c7eb
commit c49345c31b
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -7,7 +7,7 @@
Create saved filter Create saved filter
</x-button> </x-button>
<fancycheckbox class="show-archived-check" v-model="showArchived"> <fancycheckbox class="show-archived-check" v-model="showArchived" @change="saveShowArchivedState">
Show Archived Show Archived
</fancycheckbox> </fancycheckbox>
@ -99,6 +99,7 @@ export default {
} }
}, },
created() { created() {
this.showArchived = localStorage.getItem('showArchived') ?? false
this.loadBackgroundsForLists() this.loadBackgroundsForLists()
}, },
mounted() { mounted() {
@ -136,6 +137,9 @@ export default {
this.$store.dispatch('lists/toggleListFavorite', list) this.$store.dispatch('lists/toggleListFavorite', list)
.catch(e => this.error(e, this)) .catch(e => this.error(e, this))
}, },
saveShowArchivedState() {
localStorage.setItem('showArchived', this.showArchived)
},
}, },
} }
</script> </script>