I'm creating an app where users submit a request via a button, and then the app requires (for security reasons) that they not be able to return to that page for a fairly short while (say, ten to twenty seconds). The app is not intended for a purpose such that a wait like this should be a major issue (it's intended as a frontend for a kind of Ethereum voting app, ergo a person should use it fairly infrequently.
The contract has built-in protections to prevent the same account from voting multiple times, but these don't work if the user can return to the voting screen before their vote is mined, which takes about 10-15 seconds). Simply putting a lengthy delay each time the page is loaded seems feasible, but might irritate users.
I had an idea to locally store a user's details after they cast a vote, and to disallow anyone from interacting with the voting page if their details were in the list of people who've voted already (which would be updated such that a name should be removed from it a short time after). However, while this might work, it seems like it'd be a pain to scale up, since the whole array would need to be iterated constantly.
Does anyone have a better way that I could ensure that people aren't able to return to (or at least, interact with) the first page for 10-20 seconds after leaving it? Thanks.