Encapsulate this in a function `restoreButtonState()` please.