MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / addDefaultSignature

Function addDefaultSignature

apps/OpenSign/src/pages/PdfRequestFiles.jsx:1193–1211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1191 };
1192 //function to add default signature for all requested placeholder of sign
1193 const addDefaultSignature = async () => {
1194 const type = defaultSignAlert?.type;
1195 //get current signers placeholder position data
1196 const currentSignerPosition = signerPos?.filter(
1197 (data) => data.signerObjId === signerObjectId
1198 );
1199 const defaultSign = type === "signature" ? defaultSignImg : myInitial;
1200 const placeHolder = currentSignerPosition[0].placeHolder;
1201 const filename = type === "signature" ? "mysign" : "myinitials";
1202 const signImg = await convertJpegToPng(defaultSign, filename);
1203 //function for save default signature url for all placeholder position
1204 const updatePlace = addDefaultSignatureImg(placeHolder, signImg, type);
1205
1206 const updatesignerPos = signerPos.map((x) =>
1207 x.signerObjId === signerObjectId ? { ...x, placeHolder: updatePlace } : x
1208 );
1209 setSignerPos(updatesignerPos);
1210 setDefaultSignAlert({ isShow: false, alertMessage: "" });
1211 };
1212 const handleDontShow = (isChecked) => {
1213 setIsDontShow(isChecked);
1214 };

Callers 1

PdfRequestFilesFunction · 0.85

Calls 2

convertJpegToPngFunction · 0.90
addDefaultSignatureImgFunction · 0.90

Tested by

no test coverage detected