It's used to disable the button when connecting, to prevent a user from clicking the button multiple times.