-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with onSuccess
with bad argument
#231
Conversation
src/ARToolkitNFT.ts
Outdated
@@ -272,7 +269,7 @@ export default class ARToolkitNFT { | |||
onError2(errorNumber); | |||
}; | |||
|
|||
let Ids: any = []; | |||
let Ids: [{id: number}]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct but it is a silent error, when the marker is loaded you will receive this kind of error:
aa1e448a-43ef-43be-881e-d5c11c836675:1 Error in loading marker on Worker TypeError: Cannot read properties of undefined (reading 'push')
at aa1e448a-43ef-43be-881e-d5c11c836675:1:748671
at Array.forEach (<anonymous>)
at A.value (aa1e448a-43ef-43be-881e-d5c11c836675:1:748283)
at A.<anonymous> (aa1e448a-43ef-43be-881e-d5c11c836675:1:755365)
at G (aa1e448a-43ef-43be-881e-d5c11c836675:1:928)
at Generator.<anonymous> (aa1e448a-43ef-43be-881e-d5c11c836675:1:2283)
at Generator.next (aa1e448a-43ef-43be-881e-d5c11c836675:1:1291)
at A (aa1e448a-43ef-43be-881e-d5c11c836675:1:8095)
at i (aa1e448a-43ef-43be-881e-d5c11c836675:1:8298)
at aa1e448a-43ef-43be-881e-d5c11c836675:1:8357
(anonymous) @ aa1e448a-43ef-43be-881e-d5c11c836675:1
Promise.catch (async)
(anonymous) @ aa1e448a-43ef-43be-881e-d5c11c836675:1
Promise.then (async)
D @ aa1e448a-43ef-43be-881e-d5c11c836675:1
C.onmessage @ aa1e448a-43ef-43be-881e-d5c11c836675:1
This commit fixed the above issue but i'm not sure that the final result is an Arrays of ids like said |
@antokhio have you tested this? If it's ok i will merge in the next days if i can. |
i found that loadNFTMarkers the onError parameter should have one argument as number instead now is empty: jsartoolkitNFT/src/ARControllerNFT.ts Lines 704 to 719 in 999764b
it should reflect the underlying addNFTMarkers: jsartoolkitNFT/src/ARToolkitNFT.ts Lines 241 to 246 in 999764b
|
I think it can be merged i tested it and i cannot find any issues. If i can i will merge very soon. |
For more infos see issue #230
The code works as usual because the distribution file is not affected but need to be tested with ARnft or other Typescript project.
I would also remove as much as possible all
any
in the code and give more consistent type checking.For testing with npm use this, replacing <hash_commit> with the actual hash commit number:
"@webarkit/jsartoolkit-nft": "https://github.com/webarkit/jsartoolkitNFT.git#<hash-commit>",