Improve startup sync timeout handling

This commit is contained in:
Tulir Asokan
2019-08-30 20:57:08 +03:00
parent db53b95ab1
commit 2313321d01
6 changed files with 35 additions and 18 deletions

View File

@ -138,11 +138,9 @@ const cmdLoginHelp = `login - Authenticate this Bridge as WhatsApp Web Client`
// CommandLogin handles login command
func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
if ce.User.Conn == nil {
if !ce.User.Connect(true) {
ce.User.log.Debugln("Connect() returned false, assuming error was logged elsewhere and canceling login.")
return
}
if !ce.User.Connect(true) {
ce.User.log.Debugln("Connect() returned false, assuming error was logged elsewhere and canceling login.")
return
}
ce.User.Login(ce)
}