Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] minor changes

Aman Raj Singh Mourya4c204e2a2a45
diff --git a/auth/lib/models/code.dart b/auth/lib/models/code.dart
index cf2d9ffce4..452ae4e3f3 100644
--- a/auth/lib/models/code.dart
+++ b/auth/lib/models/code.dart
@@ -114,18 +114,19 @@ class Code {
CodeDisplay? display,
int digits, {
Algorithm algorithm = Algorithm.sha1,
+ int period = defaultPeriod,
}) {
final String encodedIssuer = Uri.encodeQueryComponent(issuer);
return Code(
account,
issuer,
digits,
- defaultPeriod,
+ period,
secret,
algorithm,
type,
0,
- "otpauth://${type.name}/$issuer:$account?algorithm=${algorithm.name.toUpperCase()}&digits=$digits&issuer=$encodedIssuer&period=30&secret=$secret",
+ "otpauth://${type.name}/$issuer:$account?algorithm=${algorithm.name.toUpperCase()}&digits=$digits&issuer=$encodedIssuer&period=$period&secret=$secret",
display: display ?? CodeDisplay(),
);
}
diff --git a/auth/lib/ui/home_page.dart b/auth/lib/ui/home_page.dart
index 648c78eeb6..cd522b7746 100644
--- a/auth/lib/ui/home_page.dart
+++ b/auth/lib/ui/home_page.dart
@@ -580,7 +580,9 @@ class _HomePageState extends State<HomePage> {
return ClipRect(
child: CodeWidget(
- key: ValueKey('${code.hashCode}_${newIndex}_$_codeSortKey'),
+ key: ValueKey(
+ '${code.hashCode}_${newIndex}_$_codeSortKey',
+ ),
code,
isCompactMode: isCompactMode,
sortKey: _codeSortKey,
@@ -667,11 +669,13 @@ class _HomePageState extends State<HomePage> {
}
return false;
}
+
int lastScanTime = DateTime.now().millisecondsSinceEpoch - 1000;
void _handleDeeplink(BuildContext context, String? link) {
bool isAccountConfigured = Configuration.instance.hasConfiguredAccount();
- bool isOfflineModeEnabled = Configuration.instance.hasOptedForOfflineMode() &&
- Configuration.instance.getOfflineSecretKey() != null;
+ bool isOfflineModeEnabled =
+ Configuration.instance.hasOptedForOfflineMode() &&
+ Configuration.instance.getOfflineSecretKey() != null;
if (!(isAccountConfigured || isOfflineModeEnabled) || link == null) {
return;
}