File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,24 @@ const action = new FileAction({
1717
1818 const signedNodeId = node . attributes [ 'signed-node-id' ]
1919
20- return ! signedNodeId || node . fileid === signedNodeId
21- ? fileStatus . find ( status => status . id === node . attributes [ 'signature-status' ] ) . label
22- : t ( 'libresign' , 'original file' )
20+ if ( ! signedNodeId || node . fileid === signedNodeId ) {
21+ const status = fileStatus . find ( status => status . id === node . attributes [ 'signature-status' ] )
22+ return status ?. label ?? ''
23+ }
24+ return t ( 'libresign' , 'original file' )
2325 } ,
2426 exec : async ( ) => null ,
2527 iconSvgInline : ( nodes ) => {
2628 const node = nodes [ 0 ]
2729
2830 const signedNodeId = node . attributes [ 'signed-node-id' ]
2931
30- return ! signedNodeId || node . fileid === signedNodeId
31- ? fileStatus . find ( status => status . id === node . attributes [ 'signature-status' ] ) . icon
32- : fileStatus . find ( status => status . id === SIGN_STATUS . ABLE_TO_SIGN ) . icon
32+ if ( ! signedNodeId || node . fileid === signedNodeId ) {
33+ const status = fileStatus . find ( status => status . id === node . attributes [ 'signature-status' ] )
34+ return status ?. icon ?? ''
35+ }
36+ const ableToSignStatus = fileStatus . find ( status => status . id === SIGN_STATUS . ABLE_TO_SIGN )
37+ return ableToSignStatus ?. icon ?? ''
3338 } ,
3439 inline : ( ) => true ,
3540 enabled : ( nodes ) => {
You can’t perform that action at this time.
0 commit comments