diff --git a/src/frontend/app/signatures/signatures.component.ts b/src/frontend/app/signatures/signatures.component.ts index eb0793e55e89ffe33cf9ad9a7ef7d1e7b2e09db9..790b798b8f55f8a857dab37b7212d6b784295e45 100755 --- a/src/frontend/app/signatures/signatures.component.ts +++ b/src/frontend/app/signatures/signatures.component.ts @@ -121,12 +121,16 @@ export class SignaturesComponent implements OnInit { this.notificationService.success('lang.signatureInDocAdded'); this.modalController.dismiss('success'); } else { - if (signPosCurrentPage.length > 0) { + let signaturePos = this.currentWorflow.signaturePositions.filter((item: any) => item.sequence === this.posCurrentUser); + if (signPosCurrentPage.length > 0 && signPosOtherPage.length === 0) { signature.positionX = signPosCurrentPage[0].positionX; signature.positionY = signPosCurrentPage[0].positionY; this.storeSignature(signature, this.signaturesService.currentPage); - } - let signaturePos = this.currentWorflow.signaturePositions.filter((item: any) => item.sequence === this.posCurrentUser); + } else if (signPosCurrentPage.length > 0 && signPosOtherPage.length > 0) { + signature.positionX = signaturePos[0].positionX; + signature.positionY = signaturePos[0].positionY; + this.storeSignature(signature, signaturePos[0].page); + } if (signaturePos.length > 0) { signaturePos.forEach((element: { positionX: any; positionY: any; page: number; }) => { signature.positionX = element.positionX; @@ -159,6 +163,8 @@ export class SignaturesComponent implements OnInit { } else { this.modalController.dismiss({ redirectPage: this.currentWorflow.signaturePositions[0].page }); } + } else if(signPosCurrentPage.length > 0 && signPosOtherPage.length > 0) { + this.modalController.dismiss({ redirectPage: signaturePos[0].page }); } else { this.modalController.dismiss('success'); }