Skip to content

Commit d815f3e

Browse files
committed
fix(add-account): apply selected algorithm and digits immediately
The algorithm and digits <select>s used v-model without the .number modifier, so the in-memory entry held string values (e.g. "2"). The generator compares the algorithm with === against the numeric enum, so every non-SHA1 choice fell through to SHA1 until the entry was reloaded from storage (which normalises the type). Add .number like the type select already does. Refs Authenticator-Extension#1184
1 parent 17a7da4 commit d815f3e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/Popup/AddAccountPage.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@
2222
v-model.number="newAccount.period"
2323
:disabled="newAccount.type === OTPType.hotp"
2424
/>
25-
<a-select-input :label="i18n.digits" v-model="newAccount.digits">
25+
<a-select-input :label="i18n.digits" v-model.number="newAccount.digits">
2626
<option value="6">6</option>
2727
<option value="8">8</option>
2828
</a-select-input>
29-
<a-select-input :label="i18n.algorithm" v-model="newAccount.algorithm">
29+
<a-select-input
30+
:label="i18n.algorithm"
31+
v-model.number="newAccount.algorithm"
32+
>
3033
<option :value="OTPAlgorithm.SHA1">SHA-1</option>
3134
<option :value="OTPAlgorithm.SHA256">SHA-256</option>
3235
<option :value="OTPAlgorithm.SHA512">SHA-512</option>

0 commit comments

Comments
 (0)