Skip to content
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

Absolute values socket timeout is too short #30

Open
cokalyoncu opened this issue Nov 3, 2021 · 0 comments
Open

Absolute values socket timeout is too short #30

cokalyoncu opened this issue Nov 3, 2021 · 0 comments

Comments

@cokalyoncu
Copy link

function watchTicker() {
setTimeout(() => {
socket.on("message", function (a) {
var parsed = JSON.parse(a);
if ("ticker" == parsed.type) {
// console.log("result", parsed.result)
addAbsoluteResult(parsed.result);
}
});
}, 1000); // delay accessing the socket variable so we know it's initialized.
}

Timeout set while the script is running for the first time is too short. Event is trying to connect before the socket is created yet.

userscript.html?name=Cryptohopper%20MASTER%20SCRIPT.user.js&id=e18569bc-b172-4d1c-a9f2-0ffeb8f3e329:298 Uncaught TypeError: Cannot read properties of undefined (reading 'on')
at Window.eval (userscript.html?name=Cryptohopper%20MASTER%20SCRIPT.user.js&id=e18569bc-b172-4d1c-a9f2-0ffeb8f3e329:298)
at :4:80
at t. (eval at exec_fn (dashboard:2), :38:453)
at :4:80
at i (eval at exec_fn (dashboard:2), :5:165)
at eval (eval at exec_fn (dashboard:2), :5:292)
at :13:99
at HTMLDocument.v (:13:118)

@cokalyoncu cokalyoncu changed the title Absolute values socker timeout is too short Absolute values socket timeout is too short Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant