Clears the password if user cancels password prompt.

Clears the password if user cancel attempt to enter password, as using one instance of locker for multiple attempts keeps the password.
This commit is contained in:
damencho 2016-09-15 16:32:10 -05:00
parent 12344ab486
commit a449223b40
1 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,10 @@ export default function createRoomLocker (room) {
newPass => { password = newPass; }
).catch(
reason => {
// user canceled, no pass was entered.
// clear, as if we use the same instance several times
// pass stays between attempts
password = null;
if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason);
}