File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 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 }) {
212212 ? otpStorage .issuer + " :" + (otpStorage .account || " " )
213213 : otpStorage .account || " " ;
214214 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+ ) {
216228 type = OTPType .totp ;
217229 } else if (
218230 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
220234 ) {
221235 type = OTPType .hotp ;
222236 } else {
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ interface AccountsState {
6262 entries : OTPEntryInterface [ ] ;
6363 defaultEncryption : string ;
6464 encryption : Map < string , EncryptionInterface > ;
65- OTPType : number ;
65+ OTPType : OTPType ;
6666 shouldShowPassphrase : boolean ;
6767 sectorStart : boolean ;
6868 sectorOffset : number ;
You can’t perform that action at this time.
0 commit comments