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
|
font.pointSize: 10
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
opacity: isInCoolDown(modelData.name) ? 0.6 : 1
|
opacity: isExpired(modelData) ? 0.6 : 1
|
||||||
visible: modelData.code != null
|
visible: modelData.code != null
|
||||||
text: qsTr('') + modelData.code
|
text: qsTr('') + modelData.code
|
||||||
font.family: "Verdana"
|
font.family: "Verdana"
|
||||||
@ -486,7 +486,7 @@ ApplicationWindow {
|
|||||||
onTriggered: {
|
onTriggered: {
|
||||||
var timeLeft = device.expiration - (Date.now() / 1000)
|
var timeLeft = device.expiration - (Date.now() / 1000)
|
||||||
if (timeLeft <= 0 && progressBar.value > 0) {
|
if (timeLeft <= 0 && progressBar.value > 0) {
|
||||||
device.refresh(refreshDependingOnMode)
|
refreshDependingOnMode(true)
|
||||||
totpCoolDowns = []
|
totpCoolDowns = []
|
||||||
}
|
}
|
||||||
progressBar.value = timeLeft
|
progressBar.value = timeLeft
|
||||||
@ -505,6 +505,11 @@ ApplicationWindow {
|
|||||||
onTriggered: touchYourYubikey.open()
|
onTriggered: touchYourYubikey.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isExpired(cred) {
|
||||||
|
return (cred.oath_type !== 'hotp')
|
||||||
|
&& (cred.expiration - (Date.now() / 1000) <= 0)
|
||||||
|
}
|
||||||
|
|
||||||
function refreshDependingOnMode(force) {
|
function refreshDependingOnMode(force) {
|
||||||
if (hasDevice && shouldRefresh) {
|
if (hasDevice && shouldRefresh) {
|
||||||
if (settings.slotMode && device.hasOTP) {
|
if (settings.slotMode && device.hasOTP) {
|
||||||
|
@ -189,6 +189,9 @@ Python {
|
|||||||
result.push(cred)
|
result.push(cred)
|
||||||
}
|
}
|
||||||
nextRefresh = minExpiration
|
nextRefresh = minExpiration
|
||||||
|
// Credentials is cleared so that
|
||||||
|
// the view w refresh even if objects are the same
|
||||||
|
credentials = []
|
||||||
credentials = result
|
credentials = result
|
||||||
updateExpiration()
|
updateExpiration()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user