I'm not sure if this is happening due to the RainbowKit or Wagmi upgrades, but RainbowKit's connectModalOpen is now turning to false a split second before signer is set, which is causing this code to close the modal.
This setTimeout gives us a second to wait and see if signer is set before we decide if the modal closed to the user exiting it or due to a successful wallet auth.