Skip to content

Commit

Permalink
Bugfix: Don't show TOTP countdown in case HOTP is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Rookiestyle committed Jul 19, 2020
1 parent 1a07460 commit a232ab7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/DAO/OTPDAO_DB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ public override string GetReadableOTP(PwEntry pe)
if ((!otp.Loaded && Config.UseDBForOTPSeeds(otp.db)) || (otp.ValidTo == DateTime.MaxValue))
return otp.ReadableOTP;

if (otp.kpotp.Type == KPOTPType.HOTP) return otp.ReadableOTP;
int r = (otp.ValidTo - DateTime.UtcNow).Seconds;
return otp.ReadableOTP + (r < 6 ? " (" + r.ToString() + ")" : string.Empty);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DAO/OTPDAO_Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override string GetReadableOTP(PwEntry pe)
}
UpdateOTPBuffer(pe, otp);
}
if (otp.ValidTo == DateTime.MaxValue)
if ((otp.ValidTo == DateTime.MaxValue) ||(otp.kpotp.Type == KPOTPType.HOTP))
return otp.ReadableOTP;
else
{
Expand Down
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:
KeePassOTP:0.11.1
KeePassOTP:0.11.2
KeePassOTP!de:6
KeePassOTP!fr:1
:

0 comments on commit a232ab7

Please sign in to comment.