[auth] minor changes
This commit is contained in:
@@ -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(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user