Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3507 from jaoo/bug774114
Browse files Browse the repository at this point in the history
Make the unlock SIM dialog work after changing -bug774114- a bit the pla...
  • Loading branch information
timdream committed Aug 27, 2012
2 parents 05e33c2 + c5e38a2 commit f689a0b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions apps/system/js/pinlock/pinlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,18 @@ var PinLock = {
}
var unlock = this.conn.unlockCardLock({lockType: 'pin', pin: this.pinCode});
var pinLock = this;
/* whatever happens, we need to reset the status:
we got a reponse from the SIM card, so either current
PIN code is good and we will clear and exit, or it
is not and there is no point in keeping it */
unlock.onsuccess = function() {
var res = unlock.result;
/* whatever happens, we need to reset the status:
we got a reponse from the SIM card, so either current
PIN code is good and we will clear and exit, or it
is not and there is no point in keeping it */
pinLock.reset();
console.log('Unlocking SIM: ' + res.result);
if (res.result == true) {
pinLock.hideKeypad();
} else {
console.log('Bad PIN code! Number of retries: ' + res.retryCount);
this.notifyRetryCount(res.retryCount);
}
}
pinLock.hideKeypad();
};
unlock.onerror = function() {
pinLock.reset();
this.notifyRetryCount(unlock.result.retryCount);
};
this.reset();
},

Expand Down

0 comments on commit f689a0b

Please sign in to comment.