File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -212,11 +212,25 @@ function getOneLineOtpBackupFile(entryData: { [hash: string]: RawOTPStorage }) {
212
212
? otpStorage .issuer + " :" + (otpStorage .account || " " )
213
213
: otpStorage .account || " " ;
214
214
let type = " " ;
215
- if (otpStorage .type === OTPType .totp || otpStorage .type === OTPType .hex ) {
215
+ // We may have already have some error OTP type entries in the storage
216
+ // totp = 1
217
+ // hotp = 2
218
+ // battle = 3
219
+ // steam = 4
220
+ // hex = 5
221
+ // hhex = 6
222
+ if (
223
+ otpStorage .type === OTPType .totp ||
224
+ otpStorage .type === OTPType .hex ||
225
+ (otpStorage .type as unknown ) === 1 ||
226
+ (otpStorage .type as unknown ) === 5
227
+ ) {
216
228
type = OTPType .totp ;
217
229
} else if (
218
230
otpStorage .type === OTPType .hotp ||
219
- otpStorage .type === OTPType .hhex
231
+ otpStorage .type === OTPType .hhex ||
232
+ (otpStorage .type as unknown ) === 2 ||
233
+ (otpStorage .type as unknown ) === 6
220
234
) {
221
235
type = OTPType .hotp ;
222
236
} else {
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ interface AccountsState {
62
62
entries : OTPEntryInterface [ ] ;
63
63
defaultEncryption : string ;
64
64
encryption : Map < string , EncryptionInterface > ;
65
- OTPType : number ;
65
+ OTPType : OTPType ;
66
66
shouldShowPassphrase : boolean ;
67
67
sectorStart : boolean ;
68
68
sectorOffset : number ;
You can’t perform that action at this time.
0 commit comments