input view working for back button and refresh

input view working for back button and refresh
54-60 can just be:
var atCorrectState = (game && game.stateID !== 1);