mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-29 04:14:52 +03:00
Only gray out expired TOTP touch credentials.
This commit is contained in:
parent
9d7e9c37b7
commit
817d485334
@ -441,7 +441,7 @@ ApplicationWindow {
|
||||
font.pointSize: 10
|
||||
}
|
||||
Text {
|
||||
opacity: isInCoolDown(modelData.name) ? 0.6 : 1
|
||||
opacity: isExpired(modelData) ? 0.6 : 1
|
||||
visible: modelData.code != null
|
||||
text: qsTr('') + modelData.code
|
||||
font.family: "Verdana"
|
||||
@ -486,7 +486,7 @@ ApplicationWindow {
|
||||
onTriggered: {
|
||||
var timeLeft = device.expiration - (Date.now() / 1000)
|
||||
if (timeLeft <= 0 && progressBar.value > 0) {
|
||||
device.refresh(refreshDependingOnMode)
|
||||
refreshDependingOnMode(true)
|
||||
totpCoolDowns = []
|
||||
}
|
||||
progressBar.value = timeLeft
|
||||
@ -505,6 +505,11 @@ ApplicationWindow {
|
||||
onTriggered: touchYourYubikey.open()
|
||||
}
|
||||
|
||||
function isExpired(cred) {
|
||||
return (cred.oath_type !== 'hotp')
|
||||
&& (cred.expiration - (Date.now() / 1000) <= 0)
|
||||
}
|
||||
|
||||
function refreshDependingOnMode(force) {
|
||||
if (hasDevice && shouldRefresh) {
|
||||
if (settings.slotMode && device.hasOTP) {
|
||||
|
@ -189,6 +189,9 @@ Python {
|
||||
result.push(cred)
|
||||
}
|
||||
nextRefresh = minExpiration
|
||||
// Credentials is cleared so that
|
||||
// the view w refresh even if objects are the same
|
||||
credentials = []
|
||||
credentials = result
|
||||
updateExpiration()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user