Skip to content

Commit d588c6b

Browse files
committed
debug
1 parent 1c4babc commit d588c6b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

components/credentials.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export default function Credentials(props:any) {
4545
setLoading(true);
4646
if (value !== '') {
4747
const doc = props.doc;
48-
console.log(doc)
49-
console.log(props.doc)
5048
objectPath.set(doc, 'vc_type', value);
5149
const result = await fetch("/api/vp/share",
5250
{ method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify(doc) })
@@ -57,17 +55,20 @@ export default function Credentials(props:any) {
5755
setQrCode(result.link);
5856
setQrStatus(true);
5957
let check = false;
58+
let a = {};
6059
while (!check) {
6160
await sleep(5);
62-
const a = await fetch("/api/vp/status",
61+
a = await fetch("/api/vp/status",
6362
{ method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify({id: props.id}) })
6463
.then((res) => res.json());
65-
if (a.success) {
64+
if (objectPath.get(a, 'success', true)) {
6665
check = true;
67-
await load();
68-
setVcStatus(a.success);
6966
}
7067
}
68+
if (objectPath.get(a, 'success', true)) {
69+
await load();
70+
setVcStatus(true);
71+
}
7172
}
7273
}
7374

@@ -139,7 +140,6 @@ export default function Credentials(props:any) {
139140
}, [props]);
140141

141142
useEffect(() => {
142-
console.log(props.doc)
143143
load().catch(console.error);
144144
},[load]);
145145

0 commit comments

Comments
 (0)