[#1016] Save changes when moving between tabs

The `resetState` function is called when navigating between tabs