When the door meets the magnet it catches and stays closed.
How to convert bifold doors to french doors.
The final step to convert bifold doors to french doors is to attach the metal plate to the door.
You can keep the doors so that they pivot on the already existing pins like this closet door makeover.
Depending on your closet you could attach the magnetic catch to the door and the metal plate inside the closet whatever works best for you.
This is one of those things that when it breaks turns out to actually be a blessing in disguise.