Skip to content

Commit 5f4c26e

Browse files
PythonGermanyTwiN
andauthored
fix(ui): Do not store config locally on load (#1432)
* fix(ui): Do not store config locally on load * chore(ui): Regenerate static assets --------- Co-authored-by: TwiN <twin@linux.com>
1 parent 2beaca5 commit 5f4c26e

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

web/app/src/components/SearchBar.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ const sortOptions = [
6464
6565
const emit = defineEmits(['search', 'update:showOnlyFailing', 'update:showRecentFailures', 'update:groupByGroup', 'update:sortBy', 'initializeCollapsedGroups'])
6666
67-
const handleFilterChange = (value) => {
67+
const handleFilterChange = (value, store = true) => {
6868
filterBy.value = value
69-
localStorage.setItem('gatus:filter-by', value)
69+
if (store)
70+
localStorage.setItem('gatus:filter-by', value)
7071
7172
// Reset all filter states first
7273
emit('update:showOnlyFailing', false)
@@ -80,9 +81,11 @@ const handleFilterChange = (value) => {
8081
}
8182
}
8283
83-
const handleSortChange = (value) => {
84+
const handleSortChange = (value, store = true) => {
8485
sortBy.value = value
85-
localStorage.setItem('gatus:sort-by', value)
86+
if (store)
87+
localStorage.setItem('gatus:sort-by', value)
88+
8689
emit('update:sortBy', value)
8790
emit('update:groupByGroup', value === 'group')
8891
@@ -93,8 +96,8 @@ const handleSortChange = (value) => {
9396
}
9497
9598
onMounted(() => {
96-
// Apply saved filter/sort state on load
97-
handleFilterChange(filterBy.value)
98-
handleSortChange(sortBy.value)
99+
// Apply saved or application wide filter/sort state on load but do not store it in localstorage
100+
handleFilterChange(filterBy.value, false)
101+
handleSortChange(sortBy.value, false)
99102
})
100103
</script>

web/static/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)