The modal currently opens when a user tries to navigate away from the moderation submission edit page using the back button in the browser. Logically we should only do this if there is unsaved information written in the form that may be lost.
Success
The modal only appears when a user has entered information in the form and tries to leave the page without saving it.
Requirements
[x] Refactor the modal to only appear when input is not saved.
Implementation notes
Only the logic for the second if block condition needs changing the rest of the statement should not need refactoring.
Problem
The modal currently opens when a user tries to navigate away from the moderation submission edit page using the back button in the browser. Logically we should only do this if there is unsaved information written in the form that may be lost.
Success
The modal only appears when a user has entered information in the form and tries to leave the page without saving it.
Requirements
Implementation notes
Only the logic for the second if block condition needs changing the rest of the statement should not need refactoring.