i want to toggle a material ui Dialog visibility base on URL. for example when URL is somthing like this
site.com/#UKLMCBUWPO modal one be visible and when site.com/#UKLMCBUWPO&KLMCnhjmWPO
modal two be visible and each time user click the browser back button last state in url pops and the second modal be hidden and so on.
basically user can interact with browser back and forward buttons to show and hide the dialog.
i just want some gibberish text in URL when modals open and the gibrish removed when they closed until no modals are shown on the page.
any ideas ?