3030</template >
3131
3232<script >
33- import { mapState } from ' vuex'
33+ import { storeToRefs } from ' pinia'
34+ import { useBoardStore } from ' ./stores/board.js'
3435import AppNavigation from ' ./components/navigation/AppNavigation.vue'
3536import KeyboardShortcuts from ' ./components/KeyboardShortcuts.vue'
3637import { NcModal , NcContent , NcAppContent , isMobile } from ' @nextcloud/vue'
@@ -57,6 +58,17 @@ export default {
5758 boardApi,
5859 }
5960 },
61+ setup () {
62+ const boardStore = useBoardStore ()
63+ const { navShown , sidebarShown: sidebarShownState , currentBoard } = storeToRefs (boardStore)
64+
65+ return {
66+ boardStore,
67+ navShown,
68+ sidebarShownState,
69+ currentBoard,
70+ }
71+ },
6072 data () {
6173 return {
6274 addButton: {
@@ -77,11 +89,6 @@ export default {
7789 }
7890 },
7991 computed: {
80- ... mapState ({
81- navShown : state => state .navShown ,
82- sidebarShownState : state => state .sidebarShown ,
83- currentBoard : state => state .currentBoard ,
84- }),
8592 // TODO: properly handle sidebar showing for route subview and board sidebar
8693 sidebarRouterView () {
8794 // console.log(this.$route)
@@ -92,19 +99,19 @@ export default {
9299 },
93100 cardDetailsInModal: {
94101 get () {
95- return this .$store . getters . config (' cardDetailsInModal' )
102+ return this .boardStore . getConfig (' cardDetailsInModal' )
96103 },
97104 set (newValue ) {
98- this .$store . dispatch ( ' setConfig' , { cardDetailsInModal: newValue })
105+ this .boardStore . setConfig ( { cardDetailsInModal: newValue })
99106 },
100107 },
101108 },
102109 created () {
103110 const initialState = loadState (' deck' , ' initialBoards' , null )
104111 if (initialState !== null ) {
105- this .$store . dispatch ( ' loadBoards' )
112+ this .boardStore . loadBoards ( )
106113 }
107- this .$store . dispatch ( ' loadSharees' )
114+ this .boardStore . loadSharees ( )
108115 },
109116 mounted () {
110117 // Redirect to cleaner URL (without /index.php) if RewriteBase is enabled
@@ -115,7 +122,7 @@ export default {
115122 emit (' toggle-navigation' , { open: ! this .isMobile && this .navShown , _initial: true })
116123 this .$nextTick (() => {
117124 subscribe (' navigation-toggled' , (navState ) => {
118- this .$store . dispatch ( ' toggleNav' , navState .open )
125+ this .boardStore . toggleNav ( navState .open )
119126 })
120127 })
121128 },
0 commit comments