Merge pull request #5323 from LibreSign/fix/prevent-show-add-signers-early

fix: prevent show add signers early
This commit is contained in:
Vitor Mattos 2025-08-19 15:57:45 -03:00 committed by GitHub
commit 8cd6ae4723
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,6 +108,10 @@ export const useFilesStore = function(...args) {
&& file.signers
.filter(signer => signer.signed?.length > 0).length === file.signers.length
},
loadedAllData(file) {
file = this.getFile(file)
return Object.hasOwn(file, 'status')
},
canSign(file) {
file = this.getFile(file)
return !this.isFullSigned(file)
@ -132,6 +136,7 @@ export const useFilesStore = function(...args) {
canAddSigner(file) {
file = this.getFile(file)
return this.canRequestSign
&& this.loadedAllData(file)
&& (
!Object.hasOwn(file, 'requested_by')
|| file.requested_by.userId === getCurrentUser()?.uid