Good morning ssaqibh,
First of all thank you for your exposure that is already very welcome,
Yes, I fully understand what happened to you accidentally, it has happened to me and I think to other players, not only on mobile devices but also on a PC this can happen by clicking by mistake on the ( X ) in the upper right part of the game.
However, I leave your suggestion on the table so that our team of developers can analyse and verify the viability of applying a previous and obligatory question such as: "do you wish to leave the game?" which already exists but by clicking on the "Lobby" button as shown in the example of the checkers game:
https://i.ibb.co/bWCNcTj/Captura-de-ecr-2023-04-30-131446.jpg
Regards
Dav7d