Skip to content

Commit

Permalink
fix: pass correct this object to WebSocket close handler.
Browse files Browse the repository at this point in the history
As Firefox calls onclose when navigating away this led to the setTimeout running instantly because of a timeout of `undefined` which then led to a reload of the page which breaks navigating away.
  • Loading branch information
mohe2015 committed Jan 3, 2025
1 parent d4d92c4 commit 4d14c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/autoreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
break;
}
};
ws.onclose = this.onclose;
ws.onclose = () => this.onclose();
}

onclose() {
Expand Down

0 comments on commit 4d14c57

Please sign in to comment.