Instead of closing a modal immediately, we schedule a new effect that will navigate to a thread or close a modal, depending on the presence of the thread in the store. We need to run this as an effect in the next render, because we need to wait for the successful join action to be dispatched.
https://linear.app/comm/issue/ENG-8018/navigate-to-a-community-after-accepting-an-invite-link
Depends on D12317