Migrate to vue3 (fix #126) #127
@ -44,6 +44,7 @@ import { NcActionCheckbox, NcAppNavigationItem } from '@nextcloud/vue'
|
|||||||
import { mapActions, mapState } from 'pinia'
|
import { mapActions, mapState } from 'pinia'
|
||||||
import FilterIcon from 'vue-material-design-icons/Filter.vue'
|
import FilterIcon from 'vue-material-design-icons/Filter.vue'
|
||||||
import FilterSettingsIcon from 'vue-material-design-icons/FilterSettings.vue'
|
import FilterSettingsIcon from 'vue-material-design-icons/FilterSettings.vue'
|
||||||
|
import { getCookie } from '../../utils/cookies.js'
|
||||||
import { useSettings } from '../../store/settings.js'
|
import { useSettings } from '../../store/settings.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -64,6 +65,12 @@ export default {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
try {
|
||||||
|
const filters = getCookie('repod.filters')
|
||||||
|
this.filters = JSON.parse(filters)
|
||||||
|
} catch {}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useSettings, ['setFilters']),
|
...mapActions(useSettings, ['setFilters']),
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getCookie, setCookie } from '../utils/cookies.js'
|
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
import { setCookie } from '../utils/cookies.js'
|
||||||
|
|
||||||
export const useSettings = defineStore('settings', {
|
export const useSettings = defineStore('settings', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
@ -16,9 +16,3 @@ export const useSettings = defineStore('settings', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
try {
|
|
||||||
const settings = useSettings()
|
|
||||||
const filters = getCookie('repod.filters')
|
|
||||||
settings.filters = JSON.parse(filters)
|
|
||||||
} catch {}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user