refacto: cleanning the codebase

This commit is contained in:
Tom Boullay
2026-04-17 16:03:29 +02:00
parent 7e72f1e803
commit 1c48441535
17 changed files with 317 additions and 76 deletions
+6 -7
View File
@@ -39,12 +39,8 @@ export class InteractionManager {
setFocused(handle: InteractableHandle | null): void {
if (this._focused === handle) return;
// Never interrupt an active grab via focus change
if (this._holding) {
this._focused = handle;
this._emit();
return;
}
if (this._holding) return;
this._focused = handle;
this._emit();
}
@@ -59,7 +55,7 @@ export class InteractionManager {
}
releaseInteract(): void {
const handle = this._holdingHandle ?? this._focused;
const handle = this._holding ? this._holdingHandle : null;
if (!handle) return;
handle.onRelease();
@@ -77,6 +73,9 @@ export class InteractionManager {
}
destroy(): void {
this._focused = null;
this._holding = false;
this._holdingHandle = null;
this._listeners.clear();
InteractionManager._instance = null;
}