Skip to content

Commit

Permalink
Remove unnecessary sleep after google account pairing. Fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed May 30, 2024
1 parent 0236ea6 commit c1c9455
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libgm/pair_google.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,6 @@ func (c *Client) DoGaiaPairing(ctx context.Context, emojiCallback func(string))
c.triggerEvent(&events.PairSuccessful{PhoneID: fmt.Sprintf("%s/%d", c.AuthData.Mobile.GetSourceID(), destRegUnknownInt)})

go func() {
// Sleep for a bit to let the phone save the pair data. If we reconnect too quickly,
// the phone won't recognize the session the bridge will get unpaired.
time.Sleep(2 * time.Second)

err := c.Reconnect()
if err != nil {
c.triggerEvent(&events.ListenFatalError{Error: fmt.Errorf("failed to reconnect after pair success: %w", err)})
Expand Down

0 comments on commit c1c9455

Please sign in to comment.