Only refresh UI once per frame and only when it is displaying.