Since I introduced AnimatePresence to animate the exit of the command menu, the command menu wasn't working properly. By adding this animation, I had to reset the command menu states at the end of the animation, otherwise, the component inside the command menu would throw errors. The problem was that, by closing and instantly reopening the command menu, the `onExitComplete` wasn't triggered and the states weren't reset before the opening. By introducing a new state `isCommandMenuClosingState`, I can reset those states at the beginning of the opening if the animation didn't have the time to finish.
Run yarn dev while server running on port 3000