Prettified Code!
This commit is contained in:
parent
eeb25b8915
commit
82ca6269d2
1 changed files with 9 additions and 7 deletions
|
@ -75,15 +75,17 @@ const _monitorProgress = (bb, oncheck = null) => {
|
|||
};
|
||||
};
|
||||
|
||||
let busy = false
|
||||
let busy = false;
|
||||
const generating = (val) => {
|
||||
busy = val
|
||||
busy = val;
|
||||
if (busy) {
|
||||
window.onbeforeunload = async () => { await sendInterrupt(); };
|
||||
} else {
|
||||
window.onbeforeunload = null
|
||||
window.onbeforeunload = async () => {
|
||||
await sendInterrupt();
|
||||
};
|
||||
} else {
|
||||
window.onbeforeunload = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts a dream
|
||||
|
@ -733,7 +735,7 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
|||
mouse.listen.world.btn.middle.onclick.clear(onmorehandler);
|
||||
mouse.listen.world.onwheel.clear(onwheelhandler);
|
||||
isDreamComplete = true;
|
||||
generating(false)
|
||||
generating(false);
|
||||
};
|
||||
|
||||
redraw();
|
||||
|
|
Loading…
Reference in a new issue