Prettified Code!

This commit is contained in:
seijihariki 2023-01-04 21:14:52 +00:00 committed by GitHub Action
parent eeb25b8915
commit 82ca6269d2

View file

@ -75,15 +75,17 @@ const _monitorProgress = (bb, oncheck = null) => {
}; };
}; };
let busy = false let busy = false;
const generating = (val) => { const generating = (val) => {
busy = val busy = val;
if (busy) { if (busy) {
window.onbeforeunload = async () => { await sendInterrupt(); }; window.onbeforeunload = async () => {
await sendInterrupt();
};
} else { } else {
window.onbeforeunload = null window.onbeforeunload = null;
}
} }
};
/** /**
* Starts a dream * 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.btn.middle.onclick.clear(onmorehandler);
mouse.listen.world.onwheel.clear(onwheelhandler); mouse.listen.world.onwheel.clear(onwheelhandler);
isDreamComplete = true; isDreamComplete = true;
generating(false) generating(false);
}; };
redraw(); redraw();