Newbie programmer here, but even I am already implementing finite state machines which handily fix this sort of issue.
Any sort of UI without them now feels archaic.
Any sort of UI without them now feels archaic.
Don't handcuff your users for no benefit, just because you can't write a well-behaved backend.