Handle app open from which state