7272 <NcActionButton v-if =" ! board .archived && board .acl ?.length === 0 " :icon =" board .settings [' notify-due' ] === ' off' ? ' icon-sound' : ' icon-sound-off' " @click =" board .settings [' notify-due' ] === ' off' ? updateSetting (' notify-due' , ' all' ) : updateSetting (' notify-due' , ' off' )" >
7373 {{ board.settings['notify-due'] === 'off' ? t('deck', 'Turn on due date reminders') : t('deck', 'Turn off due date reminders') }}
7474 </NcActionButton >
75+ <NcActionButton :close-after-click =" true " @click =" toggleDefaultBoard " >
76+ <template #icon >
77+ <PinOffIcon v-if =" isDefaultBoard " :size =" 20 " decorative />
78+ <PinIcon v-else :size =" 20 " decorative />
79+ </template >
80+ {{ isDefaultBoard ? t('deck', 'Remove as default board') : t('deck', 'Set as default board') }}
81+ </NcActionButton >
7582 </template >
7683
7784 <!-- Due date reminder settings -->
@@ -172,6 +179,8 @@ import LeaveIcon from 'vue-material-design-icons/ExitRun.vue'
172179import AccountIcon from ' vue-material-design-icons/AccountOutline.vue'
173180import CloseIcon from ' vue-material-design-icons/Close.vue'
174181import CheckIcon from ' vue-material-design-icons/Check.vue'
182+ import PinIcon from ' vue-material-design-icons/Pin.vue'
183+ import PinOffIcon from ' vue-material-design-icons/PinOff.vue'
175184
176185import { loadState } from ' @nextcloud/initial-state'
177186import { emit } from ' @nextcloud/event-bus'
@@ -198,6 +207,8 @@ export default {
198207 CloneIcon,
199208 CloseIcon,
200209 CheckIcon,
210+ PinIcon,
211+ PinOffIcon,
201212 LeaveIcon,
202213 BoardCloneModal,
203214 BoardExportModal,
@@ -231,6 +242,7 @@ export default {
231242 cloneModalOpen: false ,
232243 exportModalOpen: false ,
233244 currentUser: getCurrentUser (),
245+ defaultBoardId: localStorage .getItem (' deck.defaultBoardId' ),
234246 }
235247 },
236248 computed: {
@@ -275,13 +287,25 @@ export default {
275287 }
276288 return ' '
277289 },
290+ isDefaultBoard () {
291+ return this .defaultBoardId === String (this .board .id )
292+ },
278293 },
279294 watch: {},
280295 mounted () {
281296 // prevent click outside event with popupItem.
282297 this .popupItem = this .$el
283298 },
284299 methods: {
300+ toggleDefaultBoard () {
301+ if (this .isDefaultBoard ) {
302+ localStorage .removeItem (' deck.defaultBoardId' )
303+ this .defaultBoardId = null
304+ } else {
305+ localStorage .setItem (' deck.defaultBoardId' , String (this .board .id ))
306+ this .defaultBoardId = String (this .board .id )
307+ }
308+ },
285309 unDelete () {
286310 clearTimeout (this .undoTimeoutHandle )
287311 this .boardApi .unDeleteBoard (this .board )
0 commit comments