Move localstorage test code after modal initialization