1
0

Refactor cleanup function in animeCat.js

This commit is contained in:
2025-05-26 04:30:07 +02:00
parent 86e655e94e
commit 13696f1f82

View File

@@ -263,14 +263,13 @@ _bindMouseHold() {
const onUpBound = onUp.bind(this);
function cleanup() {
const cleanup = () => {
window.removeEventListener('mousemove', onMoveBound);
window.removeEventListener('mouseup', onUpBound);
if (holdTimer) clearTimeout(holdTimer);
holdTimer = null;
this._pettingActive = false; // <--- Hier sauber zurücksetzen!
}
this._pettingActive = false; // Korrekt!
};
window.addEventListener('mousemove', onMoveBound);
window.addEventListener('mouseup', onUpBound);