Skip to content

Commit

Permalink
fix: add stop event to stackmat controller
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlundberg committed Dec 9, 2024
1 parent 5027e12 commit 86f63cc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/stackmat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,39 @@ export default function Stackmat() {
toast("Device disconnected");
};

/*
TESTED SECTION
----------------
The following events have been thoroughly tested using the QIYI Timer V2.
They ensure controlled behavior for handling timer events:
- Issue reported: Some users are unable to stop the timer.
*/

stackmat.on("started", onStarted);
stackmat.on("reset", onReset);
stackmat.on("timerConnected", onConnected);
stackmat.on("timerDisconnected", onDisconnected);

/*
EXPERIMENTAL SECTION
---------------------
The following event is experimental and has not been tested.
It was implemented based on the standard controller library's documentation
to handle potential edge cases where events might be missing for certain users.
Event:
- "stopped": This event is expected to trigger when the timer stops.
*/

stackmat.on("stopped", onReset);

return () => {
stackmat.off("started", onStarted);
stackmat.off("reset", onReset);
stackmat.off("timerConnected", onConnected);
stackmat.off("timerDisconnected", onDisconnected);
stackmat.off("stopped", onReset);
};
}
}, [
Expand Down

0 comments on commit 86f63cc

Please sign in to comment.