Fix JS error on un-selecting a repository