-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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)