MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / onImageChange

Function onImageChange

apps/OpenSign/src/pages/Managesign.jsx:128–142  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

126 };
127
128 const onImageChange = async (event) => {
129 if (canvasRef.current) {
130 canvasRef.current.clear();
131 }
132 setSignature("");
133 if (event.target.files && event.target.files[0]) {
134 const file = event.target.files[0];
135 const base64Img = await toDataUrl(file);
136 setImage(base64Img);
137 setIsValue(true);
138 } else {
139 setImage("");
140 setIsValue(false);
141 }
142 };
143 const handleSubmit = withSessionValidation(async (e) => {
144 e.preventDefault();
145 const isUrl = image?.includes("https") || image?.includes("http");

Callers

nothing calls this directly

Calls 1

toDataUrlFunction · 0.90

Tested by

no test coverage detected