How to control action back from details view?

Here is the case :

From a Tab named “Orders” I land on “Tiles” style view to show quickly all ordered products (components) on 2 columns, that’s fine. Now if I click on a product, I get the Details, that’s fine too.

Here I would like to offer the possibility to modify the order, for instance the Quantity.
To do that I currently use the “ON/OFF Switch” (which should be “ON” by default, see other thread) to be switched to OFF for entering new value(s).

It works perfect … except that the user has also the possibility to come Back from this screen using “BACK” action (on the top left of the screen) while modification is not yet completed !
Result is that this make things confusing for the user because Switch is still on OFF position.
What I would like to do is to forbid this “BACK” action as long as Switch is “OFF”.

I tried to use as alternative the “OK Button", but for a UX point of view it make things too complicated because it generates additional screens and worse I’m also facing other issue (see other thread).

I didn’t find other possibility to modify an order (some values of 1 line of the “Orders” sheet).
I would appreciate a simple solution, hopping I should not change too much the current design.