Don't clear password if downloading error, fix #4549
This commit is contained in:
parent
f22f4a52ef
commit
5ec426b275
@ -184,7 +184,7 @@ namespace Online
|
||||
if(isSuccess())
|
||||
login->loginSuccessful();
|
||||
else
|
||||
login->loginError(getInfo());
|
||||
login->loginError(getInfo(), !hadDownloadError());
|
||||
} // if dialog
|
||||
|
||||
// Check if failure happened during automatic (saved) signin.
|
||||
@ -205,7 +205,8 @@ namespace Online
|
||||
// this function is called from the main thread, so we can
|
||||
// push screens without synchronisations.
|
||||
UserScreen::getInstance()->push();
|
||||
UserScreen::getInstance()->loginError(getInfo());
|
||||
UserScreen::getInstance()->loginError(getInfo(),
|
||||
!hadDownloadError());
|
||||
}
|
||||
|
||||
|
||||
|
@ -604,13 +604,15 @@ void BaseUserScreen::loginSuccessful()
|
||||
/** Callback from player profile if login was unsuccessful.
|
||||
* \param error_message Contains the error message.
|
||||
*/
|
||||
void BaseUserScreen::loginError(const irr::core::stringw & error_message)
|
||||
void BaseUserScreen::loginError(const irr::core::stringw & error_message,
|
||||
bool clear_password)
|
||||
{
|
||||
m_state = (UserScreenState) (m_state & ~STATE_LOGIN);
|
||||
PlayerProfile *player = getSelectedPlayer();
|
||||
// Clear information about saved session in case of a problem,
|
||||
// which allows the player to enter a new password.
|
||||
if(player && player->hasSavedSession())
|
||||
// Only if not a download error
|
||||
if(clear_password && player && player->hasSavedSession())
|
||||
player->clearSession();
|
||||
player->setLastOnlineName("");
|
||||
makeEntryFieldsVisible();
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
const core::stringw &online_name="",
|
||||
const core::stringw &password="");
|
||||
void loginSuccessful();
|
||||
void loginError(const irr::core::stringw &error_message);
|
||||
void loginError(const irr::core::stringw &error_message, bool clear_password);
|
||||
void logoutSuccessful();
|
||||
void logoutError(const irr::core::stringw &error_message);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user