mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +01:00
Fix unresponsive handler being attached many times
This commit is contained in:
parent
772317a4f1
commit
de8e5ef441
@ -48,11 +48,12 @@ function promptForReload(window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function attachUnresponsiveAppHandler(window) {
|
function attachUnresponsiveAppHandler(window) {
|
||||||
window.on('unresponsive', () => promptForReload(window));
|
window.unresponsiveHandler = () => promptForReload(window);
|
||||||
|
window.on('unresponsive', window.unresponsiveHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
function detachUnresponsiveAppHandler(window) {
|
function detachUnresponsiveAppHandler(window) {
|
||||||
window.off('unresponsive', () => promptForReload(window));
|
window.off('unresponsive', window.unresponsiveHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showErrorBox(title, error) {
|
function showErrorBox(title, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user