File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 @click =" addSigner" >
1010 {{ t('libresign', 'Add signer') }}
1111 </NcButton >
12- <Signers :signers =" filesStore.signers"
13- event =" libresign:edit-signer" >
12+ <Signers event =" libresign:edit-signer" >
1413 <template #actions =" {signer } " >
1514 <NcActionButton v-if =" filesStore.canSave() && !signer.signed"
1615 aria-label =" Delete"
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default {
3535 },
3636 computed: {
3737 signers () {
38- return this .filesStore .getFile ()? .signers ?? []
38+ return this .filesStore .getFile ().signers
3939 },
4040 },
4141}
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const slugfy = (val) =>
3131 . replace ( / - + $ / , '' )
3232
3333export const useFilesStore = function ( ...args ) {
34+ const emptyFile = { signers : [ ] }
3435 const store = defineStore ( 'files' , {
3536 state : ( ) => {
3637 return {
@@ -67,7 +68,7 @@ export const useFilesStore = function(...args) {
6768 if ( typeof file === 'object' ) {
6869 return file
6970 }
70- return this . files [ this . selectedNodeId ] ?? { }
71+ return this . files [ this . selectedNodeId ] || emptyFile
7172 } ,
7273 async flushSelectedFile ( ) {
7374 const files = await this . getAllFiles ( {
@@ -214,6 +215,9 @@ export const useFilesStore = function(...args) {
214215 }
215216 }
216217 this . getFile ( ) . signers . push ( signer )
218+ const selected = this . selectedNodeId
219+ this . selectFile ( - 1 ) // to force reactivity
220+ this . selectFile ( selected ) // to force reactivity
217221 } ,
218222 async deleteSigner ( signer ) {
219223 if ( ! isNaN ( signer . signRequestId ) ) {
You can’t perform that action at this time.
0 commit comments