[JS] wrap refreshing lines to the done callback