Skip to content

Absolute values socket timeout is too short #30

@cokalyoncu

Description

@cokalyoncu

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions