Zarel/Pokemon-Showdown-Client — pull request #281 by asgdf (2014-12-10 01:04:23+00:00)
Title: fix rematch option

this.battle isn't available anymore after closing said battle, so the challenging should go before the closing