Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update TotpViewer.razor (#672)
Leendert de Borst038e8babb1c2
diff --git a/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razor b/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razorindex 21dc62fac..eff7fd6dc 100644--- a/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razor+++ b/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razor@@ -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>