From 038e8babb1c2dfd215cb8388f65fed787cfbb3d7 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Tue, 11 Mar 2025 14:17:49 +0100 Subject: [PATCH] Update TotpViewer.razor (#672) --- .../Components/TotpCodes/TotpViewer.razor | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razor b/src/AliasVault.Client/Main/Components/TotpCodes/TotpViewer.razor index 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); } + /// + /// Gets the remaining percentage for the TOTP code. + /// + /// The remaining percentage. + 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); + } + /// /// Refreshes the TOTP codes by generating new codes based on the secret keys. /// @@ -141,17 +152,6 @@ return newCode; } - /// - /// Gets the remaining percentage for the TOTP code. - /// - /// The remaining percentage. - private int GetRemainingPercentage() - { - var remaining = GetRemainingSeconds(); - // Invert the percentage so it counts down instead of up - return (int)(((30.0 - remaining) / 30.0) * 100); - } - /// /// Copies the TOTP code to the clipboard. ///