Skip to content

Commit 76491a7

Browse files
fix: add comment
1 parent 7373b08 commit 76491a7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,32 +198,41 @@ function PlaceHolderSign() {
198198
const documentData = await contractDocument(documentId);
199199
if (documentData && documentData.length > 0) {
200200
const alreadyPlaceholder = documentData[0]?.SignedUrl;
201-
201+
// Check if document is sent for signing
202202
if (alreadyPlaceholder) {
203+
// Check if the document is completed
203204
const isCompleted =
204205
documentData[0].IsCompleted && documentData[0]?.IsCompleted;
206+
// Get the expiration date of the document
205207
const expireDate = documentData[0].ExpiryDate.iso;
208+
// Check if the document has been declined
206209
const declined =
207210
documentData[0].IsDeclined && documentData[0]?.IsDeclined;
211+
// Get the expiration update date in milliseconds
208212
const expireUpdateDate = new Date(expireDate).getTime();
213+
// Get the current date in milliseconds
209214
const currDate = new Date().getTime();
210215
if (isCompleted) {
216+
// If document is completed
211217
setIsAlreadyPlace({
212218
status: true,
213219
message: "This document has been signed by all Signers."
214220
});
215221
} else if (declined) {
222+
// If document has been declined
216223
setIsAlreadyPlace({
217224
status: true,
218225
message:
219226
"This document has been declined by one or more recipient(s)."
220227
});
221228
} else if (currDate > expireUpdateDate) {
229+
// If document has expired
222230
setIsAlreadyPlace({
223231
status: true,
224232
message: "This Document is no longer available."
225233
});
226234
} else {
235+
// If document is dispatched for signing
227236
setIsAlreadyPlace({
228237
status: true,
229238
message: "The document has already been dispatched for signing."
@@ -1786,9 +1795,6 @@ function PlaceHolderSign() {
17861795
isOpen={isAlreadyPlace.status}
17871796
title={"Document Alert"}
17881797
showClose={false}
1789-
// handleClose={() => {
1790-
// setIsAlreadyPlace({status:false});
1791-
// }}
17921798
>
17931799
<div style={{ height: "100%", padding: 20 }}>
17941800
<p>{isAlreadyPlace.message}</p>

0 commit comments

Comments
 (0)