fix: prevent double registration on reconnect

When a reconnection occurs, a connect event is emitted on the client side. Before this fix the client was registering again on reconnect and then executing again (which was then causing a full page reload).