Save the type of the event
Get current state from local storage if possible