Prototyping quest- in a whatsapp like proto how to close deactivate one chat when other is clicked?

I am making a proto for chatgpt but have hit a roadblock. Clicking a chat makes it active and that works fine, but when i click on the other chat, both become active. I want to deactivate the previous when and open only one chat at a time.

Is there a solution to that?