Skip to content

Commit a541c46

Browse files
authored
Merge pull request #6215 from LibreSign/backport/6213/stable32
[stable32] feat: persist signer identify tab preference
2 parents 7a483ee + 01327ef commit a541c46

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

lib/Service/AccountService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public function getConfig(?IUser $user = null): array {
199199
$info['crl_filters'] = $this->getUserConfigCrlFilters($user);
200200
$info['crl_sort'] = $this->getUserConfigCrlSort($user);
201201
$info['grid_view'] = $this->getUserConfigByKey('grid_view', $user) === '1';
202+
$info['signer_identify_tab'] = $this->getUserConfigByKey('signer_identify_tab', $user);
202203

203204
return array_filter($info);
204205
}

src/Components/RightSidebar/RequestSignatureTab.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@
122122
:size="size"
123123
:name="modalTitle"
124124
@closing="filesStore.disableIdentifySigner()">
125-
<NcAppSidebar :name="modalTitle">
125+
<NcAppSidebar :name="modalTitle"
126+
:active="activeTab"
127+
@update:active="onTabChange">
126128
<NcAppSidebarTab v-for="method in enabledMethods()"
127129
:id="`tab-${method.name}`"
128130
:key="method.name"
@@ -225,6 +227,7 @@ import router from '../../router/router.js'
225227
import { useFilesStore } from '../../store/files.js'
226228
import { useSidebarStore } from '../../store/sidebar.js'
227229
import { useSignStore } from '../../store/sign.js'
230+
import { useUserConfigStore } from '../../store/userconfig.js'
228231
229232
const iconMap = {
230233
svgAccount,
@@ -274,7 +277,8 @@ export default {
274277
const filesStore = useFilesStore()
275278
const signStore = useSignStore()
276279
const sidebarStore = useSidebarStore()
277-
return { filesStore, signStore, sidebarStore }
280+
const userConfigStore = useUserConfigStore()
281+
return { filesStore, signStore, sidebarStore, userConfigStore }
278282
},
279283
data() {
280284
return {
@@ -287,6 +291,7 @@ export default {
287291
showConfirmRequest: false,
288292
showConfirmRequestSigner: false,
289293
selectedSigner: null,
294+
activeTab: '',
290295
}
291296
},
292297
computed: {
@@ -399,6 +404,8 @@ export default {
399404
async mounted() {
400405
subscribe('libresign:edit-signer', this.editSigner)
401406
this.filesStore.disableIdentifySigner()
407+
408+
this.activeTab = this.userConfigStore.signer_identify_tab || ''
402409
},
403410
beforeUnmount() {
404411
unsubscribe('libresign:edit-signer')
@@ -418,6 +425,10 @@ export default {
418425
}
419426
}
420427
}, 1000)
428+
429+
this.debouncedTabChange = debounce((tabId) => {
430+
this.userConfigStore.update('signer_identify_tab', tabId)
431+
}, 500)
421432
},
422433
methods: {
423434
getSvgIcon(name) {
@@ -486,6 +497,12 @@ export default {
486497
this.signerToEdit = signer
487498
this.filesStore.enableIdentifySigner()
488499
},
500+
onTabChange(tabId) {
501+
if (this.activeTab !== tabId) {
502+
this.activeTab = tabId
503+
this.debouncedTabChange(tabId)
504+
}
505+
},
489506
updateSigningOrder(signer, value) {
490507
const order = parseInt(value, 10)
491508
const file = this.filesStore.getFile()

0 commit comments

Comments
 (0)