mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-19 23:28:23 -04:00
Update TotpViewer.razor (#672)
This commit is contained in:
committed by
Leendert de Borst
parent
0845477041
commit
038e8babb1
@@ -106,6 +106,17 @@
|
||||
return step - (int)(unixTimestamp % step);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remaining percentage for the TOTP code.
|
||||
/// </summary>
|
||||
/// <returns>The remaining percentage.</returns>
|
||||
private static int GetRemainingPercentage()
|
||||
{
|
||||
var remaining = GetRemainingSeconds();
|
||||
// Invert the percentage so it counts down instead of up
|
||||
return (int)(((30.0 - remaining) / 30.0) * 100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the TOTP codes by generating new codes based on the secret keys.
|
||||
/// </summary>
|
||||
@@ -141,17 +152,6 @@
|
||||
return newCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remaining percentage for the TOTP code.
|
||||
/// </summary>
|
||||
/// <returns>The remaining percentage.</returns>
|
||||
private int GetRemainingPercentage()
|
||||
{
|
||||
var remaining = GetRemainingSeconds();
|
||||
// Invert the percentage so it counts down instead of up
|
||||
return (int)(((30.0 - remaining) / 30.0) * 100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies the TOTP code to the clipboard.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user