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

Function loadImage

apps/OpenSign/src/components/pdf/PlaceholderType.jsx:123–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 //function is used to get prefill image's signedUrl after expired
122 useEffect(() => {
123 const loadImage = async () => {
124 const isBase64Url = isBase64(props?.pos?.SignUrl);
125 if (
126 props.pos.SignUrl &&
127 props.pos.type === "image" &&
128 props?.data?.Role === "prefill" &&
129 !isBase64Url
130 ) {
131 const getPrefillImg = prefillImg?.find((x) => x.id === props.pos.key);
132 if (getPrefillImg) {
133 setImgUrl(getPrefillImg?.base64);
134 }
135 } else {
136 setImgUrl(props.pos.SignUrl);
137 }
138 };
139 if (!props?.isPrefillModal) {
140 loadImage();
141 }

Callers 1

PlaceholderTypeFunction · 0.85

Calls 1

isBase64Function · 0.90

Tested by

no test coverage detected