summaryrefslogtreecommitdiff
path: root/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'source/ui')
-rw-r--r--source/ui/MainMenu.mc6
-rw-r--r--source/ui/PinView.mc13
2 files changed, 8 insertions, 11 deletions
diff --git a/source/ui/MainMenu.mc b/source/ui/MainMenu.mc
index db59f4a..21f427c 100644
--- a/source/ui/MainMenu.mc
+++ b/source/ui/MainMenu.mc
@@ -118,8 +118,10 @@ class MainMenuDelegate extends WatchUi.Menu2InputDelegate {
} else if (vault.session.isUnlocked()) {
WatchUi.switchToView(new PinView(PinView.MODE_CHANGE, null), new PinDelegate(), WatchUi.SLIDE_LEFT);
} else {
- var then = new ChangePinAfterUnlock();
- WatchUi.switchToView(new PinView(PinView.MODE_UNLOCK, then.method(:run)), new PinDelegate(), WatchUi.SLIDE_LEFT);
+ // A legacy PIN is followed by the forced new-PIN screen, which
+ // is already the change: no second one after it.
+ var then = vault.isLegacyPin() ? null : new ChangePinAfterUnlock().method(:run);
+ WatchUi.switchToView(new PinView(PinView.MODE_UNLOCK, then), new PinDelegate(), WatchUi.SLIDE_LEFT);
}
} else if (id == :reset) {
// Two short lines (the item said "Reset PIN"): the native dialog shows
diff --git a/source/ui/PinView.mc b/source/ui/PinView.mc
index 47b12fd..af18e2b 100644
--- a/source/ui/PinView.mc
+++ b/source/ui/PinView.mc
@@ -515,16 +515,11 @@ class PinDelegate extends WatchUi.BehaviorDelegate {
return true;
}
- // START on a touch screen submits only a legacy PIN. Otherwise it does
- // nothing: one tap can arrive both here and in onTap, and submitting
- // the digits typed so far was a wrong PIN.
+ // START on a touch screen does nothing, in every mode: one tap can arrive
+ // both here and in onTap, and submitting the digits typed so far was a
+ // counted wrong PIN. A legacy PIN is submitted with the tappable OK key.
function onKey(event as WatchUi.KeyEvent) as Boolean {
- var v = view();
- if (v != null && Ui.isTouch() && event.getKey() == WatchUi.KEY_ENTER) {
- if (v.legacy) {
- v.markChanged();
- v.press(PinView.KEY_OK);
- }
+ if (Ui.isTouch() && event.getKey() == WatchUi.KEY_ENTER) {
return true;
}
return false;